arakashic / chromatica.nvim

Clang based syntax highlighting for Neovim
MIT License
299 stars 17 forks source link

Different coloring in a header vs cpp file #40

Open kartikmohta opened 6 years ago

kartikmohta commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Same problem here.

phush0 commented 6 years ago

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 commented 6 years ago

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