Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

Different coloring in a header vs cpp file #40

Open
kartikmohta opened this issue Nov 7, 2017 · 5 comments
Open

Different coloring in a header vs cpp file #40

kartikmohta opened this issue Nov 7, 2017 · 5 comments

Comments

@kartikmohta
Copy link

I noticed slightly different coloring in a header vs a cpp file, see screenshot:

chromatica_bug

Don't know if this is expected, seems wrong to me.
The relevant settings in my vimrc are:

let g:chromatica#enable_at_startup=1
let g:chromatica#highlight_feature_level=1
@arakashic
Copy link
Owner

I think the cause might be you have different ft and syn. The one on the left seems treating the source code as C not C++.

@kartikmohta
Copy link
Author

I checked the values of ft and syn for them and they are cpp for both. Tried disabling all other vim plugins as well but get the same behaviour.

@davidkennedydev
Copy link

Same problem here.

@phush0
Copy link

phush0 commented Jan 11, 2018

This is because libclang don't know how to compile header files, and they are not included in compile_commands.json. This is common problem to all plugins using lbclang

@arakashic
Copy link
Owner

For anyone run into this problem, are you using a compile_commands.json or a .clang file for your compile args?

jdkula added a commit to jdkula/chromatica.nvim that referenced this issue Nov 22, 2018
…with a matching filename, if configured to do so. (Also update README.md to document this.)

Resolves arakashic#59 and (I believe) arakashic#40.
Header highlighting would fail if compile arguments for the header file were omitted from compile_commands.json (as they often are). This resolves the issue by simply searching for a matching source file in the database.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants