ruby-mode: Fix method call indentation in rhs of multiple assignment
* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Special-case assignment that follows a comma-separated list (bug#61871). * test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add case.
This commit is contained in:
parent
16d012cf3b
commit
48a0804d10
2 changed files with 13 additions and 5 deletions
|
@ -916,11 +916,14 @@ This only affects the output of the command `ruby-toggle-block'."
|
|||
(smie-indent--hanging-p))
|
||||
ruby-indent-level)))
|
||||
(`(:before . "=")
|
||||
(save-excursion
|
||||
(and (smie-rule-parent-p " @ ")
|
||||
(goto-char (nth 1 (smie-indent--parent)))
|
||||
(smie-rule-prev-p "def=")
|
||||
(cons 'column (+ (current-column) ruby-indent-level -3)))))
|
||||
(or
|
||||
(save-excursion
|
||||
(and (smie-rule-parent-p " @ ")
|
||||
(goto-char (nth 1 (smie-indent--parent)))
|
||||
(smie-rule-prev-p "def=")
|
||||
(cons 'column (+ (current-column) ruby-indent-level -3))))
|
||||
(and (smie-rule-parent-p ",")
|
||||
(smie-rule-parent))))
|
||||
(`(:after . ,(or "?" ":"))
|
||||
(if ruby-after-operator-indent
|
||||
ruby-indent-level
|
||||
|
|
|
@ -163,6 +163,11 @@ def test2 (arg)
|
|||
)
|
||||
end
|
||||
|
||||
# Bug#61871
|
||||
foo, bar = baz.(
|
||||
some_arg
|
||||
)
|
||||
|
||||
# Bug#17097
|
||||
if x == :!=
|
||||
something
|
||||
|
|
Loading…
Add table
Reference in a new issue