octol / vim-cpp-enhanced-highlight

Additional Vim syntax highlighting for C++ (including C++11/14/17)
MIT License
1.07k stars 150 forks source link

conditions can break highlighting #13

Open wreed4 opened 9 years ago

wreed4 commented 9 years ago

The line "for ( int i=0; i<number; i++) ..." breaks highlighting for everything below it. To fix it, put a space after the "<". I imagine, this plugin is thinking the user is trying to create a template.

This is caused by the "experimental template highlighting". It may be a known bug. Sorry if it is.

(Also, yes there should be spaces there anyways, I agree. It's not my code :P)

octol commented 9 years ago

Yes this is currently an unfortunate restriction. See also https://stackoverflow.com/questions/13627544/in-vim-is-there-any-way-to-define-syn-region-for-template-angle-brackets-withou for a discussion on this. Right now there is nothing in the pipeline that will fix this, but I of course accept patches.