mxw / vim-jsx

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

Do not consider << as a start tag #6

Closed dchest closed 10 years ago

dchest commented 10 years ago

This is, of course, not ideal, as mentioned in #5, but having a right shift operator followed by a number or identifier is more common than a less than operator followed by JSX tag.

mxw commented 10 years ago

You want to add <\@<! rather than what you added—this is a zero-width match that succeeds only if the preceding atom was not < (see :help \@<!). Your change will cause the start tag to match an extra character before the opening <.

Would you still find this amendment necessary if we checked for the @jsx pragma?

dchest commented 10 years ago

Thank you, I changed it as suggested.

I think it's still a good idea even with @jsx pragma detection, but the latter will certainly make it easier to live with :-)