vim-lsp-cxx-highlight icon indicating copy to clipboard operation
vim-lsp-cxx-highlight copied to clipboard

Highlight disappears when using vim and calling :ClangFormat

Open ghost opened this issue 3 years ago • 2 comments

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.

ghost avatar Feb 15 '21 17:02 ghost

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:

  • Try writing the file after formatting :w, does this cause highlighting to reappear?
  • Run command :LspCxxHighlight right after formatting.

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.

jackguo380 avatar Mar 14 '21 22:03 jackguo380

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)

Badhi avatar May 14 '21 03:05 Badhi