Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: highlights removed after changing colorscheme #654

Open
gravityblast opened this issue Sep 27, 2024 · 2 comments
Open

bug: highlights removed after changing colorscheme #654

gravityblast opened this issue Sep 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@gravityblast
Copy link

Describe the bug

If I change the colorscheme during a session, or if the colorscheme is applied by a plugin loaded after avante, the highlights in the titles are not set.

To reproduce

Change colorscheme during a session

Expected behavior

The highlights in the titles should remain.

I notice that it works changing

api.nvim_create_autocmd("ColorSchemePre", {

to

api.nvim_create_autocmd("ColorScheme", {

Is ColorSchemePre used on purpose for other reasons?

Environment

NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    -- add any other plugins here
  },
})
@gravityblast gravityblast added the bug Something isn't working label Sep 27, 2024
@aarnphm
Copy link
Collaborator

aarnphm commented Sep 27, 2024

@srgsanky
Copy link

+1, I had to use the following workaround

      -- Highlight groups have to be reinitialized after setting the color scheme
      -- <https:/yetone/avante.nvim/issues/654>
      vim.api.nvim_create_autocmd('ColorScheme', {
        callback = function()
          require('avante.highlights').setup()
        end,
      })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants