akinsho / git-conflict.nvim

A plugin to visualise and resolve merge conflicts in neovim
953 stars 34 forks source link

colorscheme highlights issue #74

Closed itsfrank closed 10 months ago

itsfrank commented 10 months ago

It seems that this commit 75e90560521e5e395452e9a9f36309ae8f6000a7 introduced an issue with colorscheme highlights loading. Reverting the commit fixed the issue for me.

This is rather strange, to try and figure out what is happening, I added a print statement to the 'ColorScheme' autocmd callback:

print('setting highlights with scheme: ' .. vim.g.colors_name)

When I launch neovim I see what I expect: setting highlights with scheme: catppuccin-mocha, however when I open a file with a conflict, I have the wrong highlights. What is more strange, is that if I manually run :lua vim.cmd.colorscheme("catppuccin"), then the highlights fix temselves.

Here is a video demonstrating the issue (including the added print statement):

https://github.com/akinsho/git-conflict.nvim/assets/7297152/4045e0e5-3e48-4e42-9d1a-36340ada91ce

Not too sure what is causing this, but for now, I can revert to v1.1.1 before the above commit

akinsho commented 10 months ago

@itsFrank that commit was specifically introduced so that by default the highlights set by this plugin can be overriden externally by users or plugins which is what default adds. It is a common mistake/user error that highlights are not consistently re-appliced when the Colorscheme autocommand is run or that some other plugin or theme is changing these highlights.

It's almost certainly a sign of a config level issue (i.e. issue your config) that this change broke things as it means that somewhere in your config either your highlights aren't re-applied on Colorscheme autocommand or something else is interfering. In general the solution will require you to do some investigation and debugging to figure out what's going on and isn't something I can help with as it will be specific to your setup