gavocanov / vim-js-indent

JavaScript indentation for VIM
MIT License
48 stars 5 forks source link

Indentation for implicit returns in multiline arrow functions broken #9

Open HenryMarshall opened 8 years ago

HenryMarshall commented 8 years ago

I noticed that if you split the opening and closing parens for the arguments of an arrow function, it messes up the indentation for implicit returns.

Observed:

({
  foo,
  bar
}) => (
true
)

Expected:

({
  foo,
  bar
}) => (
  true
)

Notably, this does not occur if the opening and closing parens are on the same line (or are omitted):

({foo, bar}) => (
  true
)

foo => (
  true
)

Nor does it occur when using a block (which requires an explicit return):

({
  foo,
  bar
}) => {
  return true
}

Thanks for making vim-js-indent, it works great with the rest of my config!

gavocanov commented 8 years ago

Sorry for the late reply, been really busy last few weeks. There's been a huge update to the original indent script a few weeks ago, I'll merge upstream soon here, hope this will fix your problems.

But anyway, which JavaScript syntax plugin are you using?

HenryMarshall commented 8 years ago

I was experimenting with semantic highlighting. I ultimately wound up reverting to vim-javascript because of frustrations with the highlighting (though can report that other than the above issue, indentation worked great).