octol / vim-cpp-enhanced-highlight

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

Right angled brackets seems to break highlighting #58

Open tankorsmash opened 7 years ago

tankorsmash commented 7 years ago

Seems like using brackets on a line like that breaks the highlighting for text.

{
    std::stringstream ss;
    ss << "IS NOT HIGHLIGHTED" << MyTemplate<int>{1,2,3} << "THIS IS HIGHLIGHTED";

    //or with broken code
    int var = 1;
    ss << "IS NOT HIGHLIGHTED" << var-> << "THIS IS HIGHLIGHTED"

};

The cpp settings here are:

let g:cpp_class_scope_highlight = 1
let g:cpp_member_variable_highlight = 1
let g:cpp_class_decl_highlight = 1
let g:cpp_experimental_template_highlight = 1
tankorsmash commented 7 years ago

Seems like it's related to #30 as disabling experimental seems to fix this, except with simple mode on, this happens instead:

ss << "GREEN TEXT" << std::chrono::duration_cast<std::chrono::seconds>(time_left) << " PROPER YELLOW";

The cpp settings here are similar, but simple is on instead

let g:cpp_class_scope_highlight = 1
let g:cpp_member_variable_highlight = 1
let g:cpp_class_decl_highlight = 1
let g:cpp_experimental_simple_template_highlight = 1

Without either experimental flags, this is the output, which looks more or less correct: