Commit ce41edb4 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Indent middle-of-block

keywords to their parent.
parent c7734b72
2013-12-19 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie-rules): Indent middle-of-block
keywords to their parent.
2013-12-19 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie--args-separator-p): Allow the
......
......@@ -569,8 +569,9 @@ It is used when `ruby-encoding-magic-comment-style' is set to `custom'."
(cons 'column (current-column)))))
(`(:before . "do") (ruby-smie--indent-to-stmt))
(`(:before . ".") ruby-indent-level)
(`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure")) 0)
(`(:before . ,(or `"when"))
(`(:before . ,(or `"else" `"then" `"elsif" `"rescue" `"ensure"))
(smie-rule-parent))
(`(:before . "when")
(if (not (smie-rule-sibling-p)) 0)) ;; ruby-indent-level
(`(:after . ,(or "=" "iuwu-mod" "+" "-" "*" "/" "&&" "||" "%" "**" "^" "&"
"<=>" ">" "<" ">=" "<=" "==" "===" "!=" "<<" ">>"
......
......@@ -272,6 +272,8 @@ def bar
# http://stackoverflow.com/questions/17786563/emacs-ruby-mode-if-expressions-indentation
tee = if foo
bar
else
tee
end
a = b {
......@@ -328,6 +330,8 @@ def qux
foo ||= begin
bar
tee
rescue
oomph
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment