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

in not aligned with case #9

Closed
quentin opened this issue Oct 3, 2024 · 2 comments
Closed

in not aligned with case #9

quentin opened this issue Oct 3, 2024 · 2 comments

Comments

@quentin
Copy link

quentin commented Oct 3, 2024

Hi,
I have this small indentation issue with in inside a case block when indented with GetRubyIndent:

case x
  in :a
  1
  in :b
  2
end

However I expected in to be aligned with case:

case x
in :a
  1
in :b
  2
end

Is it a reproducible behavior of the plugin or is it some configuration issue in my vim?
Thanks.

@jlcrochet
Copy link
Owner

I tested it just now and was unable to reproduce the issue, so it must be some other issue with your config.

Out of curiosity, when you open a Ruby file, what does :setlocal indentkeys? say? It should look something like this:

 
 indentkeys=o,O,!^F,0),0],0},0.,0=..,0=&.,0=end,0=end_,0=end?,0=end!,0=end:,0=else,0=else_,0=else?,0=else!,0=else:,0=elsif,0=elsif_,0=elsif?,0=elsif!,0=elsif:,0=when,0=when_,0=when?,0=when!,0=when:,0=rescue,0=rescue_,0=rescue?,0=rescue!,0=rescue:,0=ensure,0=ensure_,0=ensure?,0=ensure!,0=ensure:,0==begin,0==begin_,0==begin?,0==begin!,0==begin:,0==end,0==end_,0==end?,0==end!,0==end:,0=in,0=ina,0=inb,0=inc,0=ind,0=ine,0=inf,0=ing,0=inh,0=ini,0=inj,0=ink,0=inl,0=inm,0=inn,0=ino,0=inp,0=inq,0=inr,0=ins,0=int,0=inu,0=inv,0=inw,0=inx,0=iny,0=inz,0=in0,0=in1,0=in2,0=in3,0=in4,0=in5,0=in6,0=in7,0=in8,0=in9,0=in_,0=in?,0=in!,0=in:

If it doesn't, there might be something overwriting it or there might be an issue with loading the indent file.

@quentin
Copy link
Author

quentin commented Oct 4, 2024

Thanks for your help, I confirm it is an issue with my vim config:

:verbose set indentkeys

 indentkeys=0{,0},0),0],!^F,o,O,e,:,.,=end,=else,=elsif,=when,=ensure,=rescue,==begin,==end,=private,=protected,=public
        Last set from ~/dotfiles/.vim/indent/ruby.vim line 27

Another indent file for ruby was taking precedence, removing it fixed the issue.
Sorry for the noise.

@quentin quentin closed this as completed Oct 4, 2024
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

2 participants