RRethy / base16-nvim

Neovim plugin for building a sync base16 colorscheme. Includes support for Treesitter and LSP highlight groups.
MIT License
523 stars 77 forks source link

Colorscheme not updating for `bufferline.nvim` #55

Closed 4e554c4c closed 1 year ago

4e554c4c commented 2 years ago

I'm an avid user of nvim-base16 and I recently started to use bufferline.nvim. I also automatically change the colorscheme of my desktop (incl. neovim) on sunrise and sunset. This amounts to reloading a lua file that looks like

vim.opt.background = light
vim.cmd([[colorscheme base16-atelier-forest-light]])

This works great for everything except the bufferline, which does not change to a base16 theme and instead stays the previous theme. I have tested with different themes, and only nvim-base16 exhibits this behaviour (i.e. gruvbox -> base16 fails to work, but base16 -> gruvbox works fine).

See akinsho/bufferline.nvim#490, which this issue supersedes.

RRethy commented 2 years ago

I'm not sure I see how this is an issue with nvim-base16, this plugin is just a glorified runner for :highlight ... commands. You should reopen the issue in bufferline, if you can figure out the reload mechanism for colors it's using (instead of just using highlight group) then maybe something can be done.

4e554c4c commented 1 year ago

Hi, I've finally traced this to other colorschemes calling highlight clear, right before setting g:colors_name. For example, rose-pine does this here: https://github.com/rose-pine/neovim/blob/main/lua/rose-pine.lua#L69

For example, adding the line hi clear to the beginning of colors/colorscheme base16-atelier-forest-light.vim fixes this issue.

Can we re-open?

RRethy commented 1 year ago

I'm not entirely clear why I removed that in the first place 🤔 I see it removed last year in my git log but without a clear commit message.