vim-cpp-enhanced-highlight icon indicating copy to clipboard operation
vim-cpp-enhanced-highlight copied to clipboard

Right angled brackets seems to break highlighting

Open tankorsmash opened this issue 8 years ago • 1 comments

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 avatar Oct 21 '17 22:10 tankorsmash

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:

tankorsmash avatar Oct 21 '17 22:10 tankorsmash