enhanced-ruby-mode
enhanced-ruby-mode copied to clipboard
Paren-less multi-line method call indentation is wrong
Currenlty:
foo very_long_arg_1: "value", very_long_arg_2: "value",
very_long_arg_3: "value"
Should be:
foo very_long_arg_1: "value", very_long_arg_2: "value",
very_long_arg_3: "value"
Any update on this issue? It's rather annoying :smile:
@Fibrasek patches welcome.
@zenspider can you point me where to start? I'll be glad to fix this it'll be a good way to practice my elisp :)
I just ran into this as well. It seems parenthesis around parameters do not make a difference. Current erm indents multi-line parameter lists like this:
foo(1,
2,
3,
4)
Or without parens:
foo 1,
2,
3,
4
I would like to indent such calls like this:
foo(1,
2,
3,
4)
Is there a setting I am missing? Otherweise I would appreciate a pointer on where to look. :-)
@nmk Take a look at M-x enh-ruby-add-indent-file-local-variables
Here's what I have, with all the defaults:
foo(1,
2,
3,
4)
foo 1,
2,
3,
4
# Local Variables:
# enh-ruby-bounce-deep-indent: nil
# enh-ruby-deep-indent-construct: t
# enh-ruby-deep-indent-paren: t
# enh-ruby-hanging-brace-deep-indent-level: 0
# enh-ruby-hanging-brace-indent-level: 2
# enh-ruby-hanging-indent-level: 2
# enh-ruby-hanging-paren-deep-indent-level: 0
# enh-ruby-hanging-paren-indent-level: 2
# enh-ruby-indent-level: 2
# enh-ruby-indent-tabs-mode: nil
# enh-ruby-preserve-indent-in-heredocs: nil
# End:
Indenting that whole file indents as you want with the parens. You might have some settings that go against that, so try first with these settings, and then M-x enh-ruby-del-file-local-variables
and see how it indents after.
@Fibrasek clone the repo, try rake
to see if all the tests pass... assuming they do, dig into the tests. They're pretty straightforward.
@nmk I should add: M-x enh-ruby-add-file-local-variables
only adds the variables that you have that are different from the defaults, so maybe start there.
@zenspider I'll look into it, thanks!
AFAICT, this is working fine for me. It seems obvious that nobody wants to patch this to work the way OP described. So should this ticket be closed?