mxw / vim-jsx

React JSX syntax highlighting and indenting for vim.
1.59k stars 95 forks source link

Indent problem with react ternary #112

Closed mnbroatch closed 8 years ago

mnbroatch commented 8 years ago

Hi, I'm using pangloss vim and there's a pretty minor issue I'm seeing...

When using a ternary operator in react with jsx as the expressions, I get a wrong indentation.

It's a pretty ugly pattern anyway, and I'm refactoring it right immediately, but I thought you might want to know, for completeness' sake.

screen shot 2016-08-15 at 10 02 38 pm 2 copy

mxw commented 8 years ago

I'm... not really sure what indentation you're expecting here. There are more parallel stylistic choices that can lead to reasonable indentation with a nested ternary-selected element—I've attached an example—but you can't expect an indenter to support all possible desired styles...

screen shot 2016-08-16 at 2 46 25 am