mxw / vim-jsx

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

Misdetects << operator as a tag #5

Closed dchest closed 10 years ago

dchest commented 10 years ago

In this screenshot after the first << operator syntax highlighting breaks:

vim-jsx-bug

mxw commented 10 years ago

This is a wontfix. You could imagine having the following:

u = u<<u>u;

which is impossible to detect context-independently. The workaround for this is just to put whitespace around your operators, which is a best practice anyway.

dchest commented 10 years ago

Well, is it possible to detect the code I quoted as a not containing tags? I'd rather have it not detect tags in the case that you quoted than detect in the one I quoted.

BTW, this is not even JSX code I quoted, it's a plain JavaScript file which is somehow got picked up by vim-jsx, so fixing operator whitespace in every JavaScript file I open is not an option.