Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paren-less multi-line method call indentation is wrong #82

Open
Eilie opened this issue May 29, 2015 · 9 comments
Open

Paren-less multi-line method call indentation is wrong #82

Eilie opened this issue May 29, 2015 · 9 comments
Assignees

Comments

@Eilie
Copy link

Eilie commented May 29, 2015

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"
@zenspider zenspider self-assigned this Jun 4, 2015
@fibrasek
Copy link

fibrasek commented May 8, 2019

Any update on this issue? It's rather annoying 😄

@zenspider
Copy link
Owner

@fibrasek patches welcome.

@fibrasek
Copy link

@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 :)

@nmk
Copy link

nmk commented Nov 28, 2019

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. :-)

@zenspider
Copy link
Owner

@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.

@zenspider
Copy link
Owner

@fibrasek clone the repo, try rake to see if all the tests pass... assuming they do, dig into the tests. They're pretty straightforward.

@zenspider
Copy link
Owner

@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.

@fibrasek
Copy link

@zenspider I'll look into it, thanks!

@zenspider
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants