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:
parent
04f5525fbb
commit
5b705bc97d
2 changed files with 8 additions and 1 deletions
|
@ -661,7 +661,9 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
|
||||||
(`(:before . ".")
|
(`(:before . ".")
|
||||||
(if (smie-rule-sibling-p)
|
(if (smie-rule-sibling-p)
|
||||||
(and ruby-align-chained-calls 0)
|
(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"))
|
(`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure"))
|
||||||
(smie-rule-parent))
|
(smie-rule-parent))
|
||||||
(`(:before . "when")
|
(`(:before . "when")
|
||||||
|
|
|
@ -317,6 +317,11 @@ def bar
|
||||||
.baz
|
.baz
|
||||||
end
|
end
|
||||||
|
|
||||||
|
abc(foo
|
||||||
|
.bar,
|
||||||
|
tee
|
||||||
|
.qux)
|
||||||
|
|
||||||
# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
|
# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
|
||||||
tee = if foo
|
tee = if foo
|
||||||
bar
|
bar
|
||||||
|
|
Loading…
Add table
Reference in a new issue