On 27/02/2023 00:57, Aaron Jensen wrote:
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index dba9ff0a846..6778507bc2b 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -908,7 +908,8 @@ ruby-smie-rules
"+=" "-=" "*=" "/=" "%=" "**=" "&=" "|=" "^=" "|"
"<<=" ">>=" "&&=" "||=" "and" "or"))
(cond
- ((not ruby-after-operator-indent)
+ ((and (not ruby-after-operator-indent)
+ (smie-indent--hanging-p))
(ruby-smie--indent-to-stmt ruby-indent-level))
((and (smie-rule-parent-p ";" nil)
(smie-indent--hanging-p))
This seems to work for me. I'm good with this being the same too as it
is with your patch:
foo + bar(
asdasd
)
Hmm, that one seems to misindent this example:
some_variable = abc + some_method(
some_argument
)
How about this patch?
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index dba9ff0a846..559b62fef54 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -909,7 +909,9 @@ ruby-smie-rules
"<<=" ">>=" "&&=" "||=" "and" "or"))
(cond
((not ruby-after-operator-indent)
- (ruby-smie--indent-to-stmt ruby-indent-level))
+ (ruby-smie--indent-to-stmt (if (smie-indent--hanging-p)
+ ruby-indent-level
+ 0)))
((and (smie-rule-parent-p ";" nil)
(smie-indent--hanging-p))
ruby-indent-level)))