Keywords in 1.8-style hashes throw off indentation #92

Closed
subwindow opened this Issue Jun 16, 2012 · 2 comments

Comments

Projects
None yet
3 participants

A keyword in a hash declared in 1.8 style with symbols throws off closing indentation for the rest of the file:

def foo
  a_hash = {:do => 'bar'}
  end # Not outdented

Note that if I use 1.9 style (do: 'bar') or use quotes ('do' => 'bar') it works just fine. I think this is somewhat related to Issue #44

dammer commented Jul 6, 2012

Some method names also break intendation:

def foo(job)
  job.do!
  end # Not outdented
Member

AndrewRadev commented Jul 18, 2012

Thanks for reporting. I've just pushed a commit to master that should fix both of these cases. I'll close the issue, but feel free to open it if you find an edge case we've missed.

Incidentally, I don't think it's related to #44. Syntax and indentation are handled mostly separately in vim-ruby. I do appreciate the attempt to help, though :).

@doudou doudou pushed a commit to doudou/vim-ruby that referenced this issue Nov 25, 2013

@AndrewRadev AndrewRadev Restrict "do" blocks a bit
This solves the problem of a "do" being detected where it's part of a
method call or a symbol.

See: vim-ruby#92
a9073e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment