mxw / vim-jsx

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

Indentation #117

Closed sassanh closed 8 years ago

sassanh commented 8 years ago

Can we take care of things like this:

const node = <div
    x="y"
    onClick={() =>
            this.xyz()
    }>
    </div>;

this.xyz() has one extra indent. It doesn't happen in normal js:

const a = () =>
    this.xyz();

Not very important but I just thought maybe you can fix it easily. I have few other more cases and I can share those here if you're interested.

mxw commented 8 years ago

Your formatting for the <div> disobeys the JSX style guidelines (at least as they were originally...), so vim-jsx does not support it. I've attached an image of the "correct" styling, which vim-jsx indents exactly as shown.

screen shot 2016-09-11 at 2 24 50 pm
sassanh commented 8 years ago

I see, thanks for info.