jackguo380 / vim-lsp-cxx-highlight

Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd
MIT License
337 stars 26 forks source link

Highlight disappears when using vim and calling :ClangFormat #52

Open ghost opened 3 years ago

ghost commented 3 years ago

Hi Jack,

First of all, thank you for the neat extension.

I have been using it with coc.nvim and nvim, and the results are as expected. No Problem here. However, something funny is happening when I use vim instead of nvim.

When opening a .c file with vim, the highlights appear as expected, however if I call :ClangFormat on the file, all highlights turn off automatically (as if I just turned off the extension).

Do you have any idea what the problem might be?

Thanks in advance.

Note: I am on Linux, using vim 8.2 and the last release of all aforementioned plugins.

jackguo380 commented 3 years ago

Hi @supersonicnumbers

I haven't used the ClangFormat command before but chances are it is doing the wrong thing after formatting. Consider filing a bug with coc.nvim as well.

Here's a couple of things you can try first:

Also could you provide some screenshots of the bug happening, for both vim and nvim. I do expect the bug to be different on the two since this plugin uses different APIs on each.

Badhi commented 3 years ago

Not sure if this is of any help, but Im using ccls, nvim-lsp with this plugin. When I use the :ClangFormat it turns off all the highlighting. But updates back again after few seconds. So I think its not an issue on this plugin (at least not on my configuration)