1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-24 07:20:37 +00:00

Indent '.' relative to the first sibling expression

* lisp/progmodes/ruby-mode.el (ruby-smie-rules):
Indent '.' relative to the first sibling expression, instead of the
parent token (bug#17213).
This commit is contained in:
Dmitry Gutov 2016-03-14 00:15:06 +02:00
parent 04f5525fbb
commit 5b705bc97d
2 changed files with 8 additions and 1 deletions

View File

@ -661,7 +661,9 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(`(:before . ".")
(if (smie-rule-sibling-p)
(and ruby-align-chained-calls 0)
ruby-indent-level))
(smie-backward-sexp ".")
(cons 'column (+ (current-column)
ruby-indent-level))))
(`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure"))
(smie-rule-parent))
(`(:before . "when")

View File

@ -317,6 +317,11 @@ def bar
.baz
end
abc(foo
.bar,
tee
.qux)
# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
tee = if foo
bar