diff options
| author | Dmitry Gutov | 2013-10-27 07:25:03 +0400 |
|---|---|---|
| committer | Dmitry Gutov | 2013-10-27 07:25:03 +0400 |
| commit | c8c605ac9ced55d55e952255787c8a6b71bf585a (patch) | |
| tree | 4a472c7516910b5bb80070ecf025ce10f1d5ac09 | |
| parent | ca7e59d46cd7c030a4b50234c0257156ce08e7e3 (diff) | |
| download | emacs-c8c605ac9ced55d55e952255787c8a6b71bf585a.tar.gz emacs-c8c605ac9ced55d55e952255787c8a6b71bf585a.zip | |
* lisp/progmodes/ruby-mode.el (ruby-smie--bosp): Anything that goes
after `=' is probably a new expression.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 | ||||
| -rw-r--r-- | test/indent/ruby.rb | 5 |
3 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b31efc50b7..96f3ab25172 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-27 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-smie--bosp): Anything that goes | ||
| 4 | after `=' is probably a new expression. | ||
| 5 | |||
| 1 | 2013-10-27 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> | 6 | 2013-10-27 RĂ¼diger Sonderfeld <ruediger@c-plusplus.de> |
| 2 | 7 | ||
| 3 | * man.el (man-imenu-title): New option. | 8 | * man.el (man-imenu-title): New option. |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index b85385a7428..441f166396e 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -334,7 +334,7 @@ explicitly declared in magic comment." | |||
| 334 | 334 | ||
| 335 | (defun ruby-smie--bosp () | 335 | (defun ruby-smie--bosp () |
| 336 | (save-excursion (skip-chars-backward " \t") | 336 | (save-excursion (skip-chars-backward " \t") |
| 337 | (or (bolp) (eq (char-before) ?\;)))) | 337 | (or (bolp) (memq (char-before) '(?\; ?=))))) |
| 338 | 338 | ||
| 339 | (defun ruby-smie--implicit-semi-p () | 339 | (defun ruby-smie--implicit-semi-p () |
| 340 | (save-excursion | 340 | (save-excursion |
diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index b4173b69bc1..633b2991d5e 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb | |||
| @@ -220,6 +220,11 @@ def bar | |||
| 220 | .baz | 220 | .baz |
| 221 | end | 221 | end |
| 222 | 222 | ||
| 223 | # http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation | ||
| 224 | tee = if foo | ||
| 225 | bar | ||
| 226 | end | ||
| 227 | |||
| 223 | # Examples below still fail with `ruby-use-smie' on: | 228 | # Examples below still fail with `ruby-use-smie' on: |
| 224 | 229 | ||
| 225 | foo = [1, 2, 3].map do |i| | 230 | foo = [1, 2, 3].map do |i| |