diff options
| author | Dmitry Gutov | 2013-10-21 07:50:06 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-21 07:50:06 +0400 |
| commit | 8c1ae48154e4c6935da3120362ea535f0dddfec5 (patch) | |
| tree | d8c450d065eeb0820bbcd4ddd7f9233b73a1af69 /test/indent/ruby.rb | |
| parent | a9f8deecce02a4acdb5259297878799b69d56a21 (diff) | |
| download | emacs-8c1ae48154e4c6935da3120362ea535f0dddfec5.tar.gz emacs-8c1ae48154e4c6935da3120362ea535f0dddfec5.zip | |
* lisp/progmodes/ruby-mode.el (ruby-mode-map): Add binding for
`smie-down-list'.
(ruby-smie--args-separator-p): Check that there's no newline
between method call and its arguments.
(ruby-smie-rules): Handle new cases: curly block with and without
parameters, hash surrounded with parens, block passed to
paren-less method call.
* test/indent/ruby.rb: New examples for indentation of blocks. Example
of hash inside parens that inflooped before this commit.
Diffstat (limited to 'test/indent/ruby.rb')
| -rw-r--r-- | test/indent/ruby.rb | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index ef89ebc1aa7..56966ebb8c0 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -40,6 +40,11 @@ foo = { # ruby-deep-indent-disabled | |||
| 40 | a: b | 40 | a: b |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | foo({ | ||
| 44 | a: b, | ||
| 45 | c: d | ||
| 46 | }) | ||
| 47 | |||
| 43 | foo = [ # ruby-deep-indent-disabled | 48 | foo = [ # ruby-deep-indent-disabled |
| 44 | 1 | 49 | 1 |
| 45 | ] | 50 | ] |
| @@ -165,6 +170,18 @@ method? arg1, | |||
| 165 | method! arg1, | 170 | method! arg1, |
| 166 | arg2 | 171 | arg2 |
| 167 | 172 | ||
| 173 | it "is a method call with block" do |asd| | ||
| 174 | foo | ||
| 175 | end | ||
| 176 | |||
| 177 | it("is too!") { | ||
| 178 | bar | ||
| 179 | } | ||
| 180 | |||
| 181 | and_this_one(has) { |block, parameters| | ||
| 182 | tee | ||
| 183 | } | ||
| 184 | |||
| 168 | # Examples below still fail with `ruby-use-smie' on: | 185 | # Examples below still fail with `ruby-use-smie' on: |
| 169 | 186 | ||
| 170 | foo + | 187 | foo + |
| @@ -192,11 +209,3 @@ method :foo, | |||
| 192 | 209 | ||
| 193 | method (a + b), | 210 | method (a + b), |
| 194 | c | 211 | c |
| 195 | |||
| 196 | it "is a method call with block" do | ||
| 197 | foo | ||
| 198 | end | ||
| 199 | |||
| 200 | it("is too!") { | ||
| 201 | bar | ||
| 202 | } | ||