AndrewRadev/splitjoin.vim

Ruby: Array splitting removes some elements

doits opened this issue · 2 comments

doits commented
[:a, :b, c: []]

# press `gS`

[
  :a,
  :b
]

# `c: []` gone missing!
# expected:

[
  :a,
  :b,
  c: []
]

That's a good catch :). I'll be honest, I hadn't realized this is valid ruby syntax!

I've pushed a commit that should fix this. It's tricky, because it'll now add and remove brackets depending on argument bracket settings, so I hope it doesn't cause new issues for some people, but it should be working for you now, either way. Could you check it out?

This example seems to work for me at this time, so I'll go ahead and close this issue.