diff options
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
-rw-r--r-- | lisp/progmodes/ruby-mode.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 7b9dcd44b24..88820a4a942 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -449,7 +449,7 @@ explicitly declared in magic comment." ((smie-rule-parent-p "def" "begin" "do" "class" "module" "for" "while" "until" "unless" "if" "then" "elsif" "else" "when" - "rescue" "ensure" "{") + "rescue" "ensure") (smie-rule-parent ruby-indent-level)) ;; For (invalid) code between switch and case. ;; (if (smie-parent-p "switch") 4) @@ -457,7 +457,9 @@ explicitly declared in magic comment." (`(:before . ,(or `"(" `"[" `"{")) (cond ((and (equal token "{") - (not (smie-rule-prev-p "(" "{" "[" "," "=>"))) + (not (smie-rule-prev-p "(" "{" "[" "," "=>")) + (or (smie-rule-hanging-p) + (smie-rule-next-p "opening-|"))) ;; Curly block opener. (smie-rule-parent)) ((smie-rule-hanging-p) |