Commit 03d44565 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/progmodes/ruby-mode.el (ruby-smie-rules): Only align with parent of

{ if it is hanging.
parent 76f1a3c3
2013-10-23 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/ruby-mode.el (ruby-smie-rules): Only align with parent of
{ if it is hanging.
* progmodes/ruby-mode.el (ruby-smie-rules): Don't return 0 for
:before ";".
......
......@@ -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)
......
......@@ -40,6 +40,10 @@
a: b
}
foo = { a: b
a1: b1
}
foo({
a: b,
c: d
......
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