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

Highlight disappears when using vim and calling :ClangFormat #52

Open
ghost opened this issue Feb 15, 2021 · 2 comments
Open

Highlight disappears when using vim and calling :ClangFormat #52

ghost opened this issue Feb 15, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 15, 2021

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
Copy link
Owner

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.

@Badhi
Copy link

Badhi commented May 14, 2021

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)

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

2 participants