diff options
| author | Dmitry Gutov | 2013-12-20 07:20:33 +0200 |
|---|---|---|
| committer | Dmitry Gutov | 2013-12-20 07:20:33 +0200 |
| commit | b520f210b12911b747cd7cd725c310bef4790a48 (patch) | |
| tree | 77e79dd61f417764f4e32a0baa2c8a35548b35bc /test/indent/ruby.rb | |
| parent | 26b75b456e536c1fb2d3979e07e82455b2d9c1ca (diff) | |
| download | emacs-b520f210b12911b747cd7cd725c310bef4790a48.tar.gz emacs-b520f210b12911b747cd7cd725c310bef4790a48.zip | |
* lisp/progmodes/ruby-mode.el (ruby-align-to-stmt-keywords): New
option.
(ruby-smie--indent-to-stmt-p): Use it.
(ruby-smie-rules): Revert the logic in the handling of `when'.
Expand the `begin' clause to handle `ruby-align-to-stmt-keywords'.
(ruby-deep-arglist, ruby-deep-indent-paren)
(ruby-deep-indent-paren-style): Update docstrings to note that the
vars don't have any effect with SMIE.
* test/automated/ruby-mode-tests.el: Add tests for
`ruby-align-to-stmt-keywords'.
* test/indent/ruby.rb: Update examples to reflect the lack of change in
default indentation of `begin' blocks.
Fixes: debbugs:16182
Diffstat (limited to 'test/indent/ruby.rb')
| -rw-r--r-- | test/indent/ruby.rb | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 1993c29efb3..7a1a225834d 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -114,17 +114,17 @@ def test2 (arg) | |||
| 114 | puts "there" | 114 | puts "there" |
| 115 | end | 115 | end |
| 116 | 116 | ||
| 117 | case a | 117 | b = case a |
| 118 | when "a" | 118 | when "a" |
| 119 | 6 | 119 | 6 |
| 120 | # Support for this syntax was removed in Ruby 1.9, so we | 120 | # Support for this syntax was removed in Ruby 1.9, so we |
| 121 | # probably don't need to handle it either. | 121 | # probably don't need to handle it either. |
| 122 | # when "b" : | 122 | # when "b" : |
| 123 | # 7 | 123 | # 7 |
| 124 | # when "c" : 2 | 124 | # when "c" : 2 |
| 125 | when "d" then 4 | 125 | when "d" then 4 |
| 126 | else 5 | 126 | else 5 |
| 127 | end | 127 | end |
| 128 | end | 128 | end |
| 129 | 129 | ||
| 130 | # Some Cucumber code: | 130 | # Some Cucumber code: |
| @@ -321,18 +321,13 @@ end | |||
| 321 | foo | | 321 | foo | |
| 322 | bar | 322 | bar |
| 323 | 323 | ||
| 324 | foo || | ||
| 325 | begin | ||
| 326 | bar | ||
| 327 | end | ||
| 328 | |||
| 329 | def qux | 324 | def qux |
| 330 | foo ||= begin | 325 | foo ||= begin |
| 331 | bar | 326 | bar |
| 332 | tee | 327 | tee |
| 333 | rescue | 328 | rescue |
| 334 | oomph | 329 | oomph |
| 335 | end | 330 | end |
| 336 | end | 331 | end |
| 337 | 332 | ||
| 338 | %^abc^ | 333 | %^abc^ |