octol / vim-cpp-enhanced-highlight

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

Syntax highlighting not fully applied #67

Open dunpyl opened 6 years ago

dunpyl commented 6 years ago

I installed the plugin via Vundle per the instructions. When I try to highlight the following small snippet:

    class Foo { 
        Function(double variable);
        MyType foo;
    }

It doesn't highlight the word Function like it does in the screenshot. It also doesn't doesn't highlight the word MyType.

I checked the highlight group and for both words it's cBlock.

What's wrong?

Maktm commented 6 years ago

I'm also having trouble with highlighting declarations. I've configured let g:cpp_class_decl_highlight = 1 but code like CustomType a; doesn't highlight CustomType even though using :hi I can see that cppStructure is already linked to Structure which is colored in. Not sure what the issue is.

rwolst commented 5 years ago

I also have this issue, I would really like MyType to be highlighted the same colour as for example int. Does anyone have a fix?

octol commented 5 years ago

CustomType a;

You're not going to be able to highlight your own types in this syntax without some kind of compiler backend, so it's a known limitation that it unlikely to be addressed anytime soon.

rwolst commented 5 years ago

I'm probably showing my lack of knowledge of how things work in the background here, but wouldn't this just require a regex e.g. class (\w+) on the file in question, along with its header imports?

Perhaps it is determining which files to look in that is the hard part.

deeingasha commented 1 year ago

It's been ages but did anyone figure it out or find another syntax highlighting solution?