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

Syntax highlighting not fully applied

Open dunpyl opened this issue 6 years ago • 5 comments

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?

dunpyl avatar May 24 '18 15:05 dunpyl

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.

Maktm avatar Aug 12 '18 17:08 Maktm

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?

rwolst avatar Aug 20 '19 10:08 rwolst

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.

octol avatar Aug 21 '19 06:08 octol

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.

rwolst avatar Aug 21 '19 06:08 rwolst

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

deeingasha avatar Nov 08 '22 11:11 deeingasha