akinsho / akinsho/bufferline.nvim
[Bug]: highlights are not fully reloaded on ColorScheme autocmd
- Lenguaje dominante
- Lua
- Estrellas
- 4.4k
- Forks
- 240
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Is there an existing issue for this?
- [x] I have searched the existing issues
### What happened?
I'm using [vscode](https://github.com/Mofiqul/vscode.nvim) theme with [auto-dark-mode.nvim](https://github.com/Mofiqul/vscode.nvim) plugin to sync nvim theme with OS dark mode preferences.
After switching vscode styles between dark and light themes, I call `vim.cmd('doautocmd ColorScheme')` to trigger highlights reload.
The bufferline reacts to `ColorScheme` event but does only partial highlights reload.\
Some highlights are still out-of-date, which causes a following appearance bug:
*Switched from light to dark*
*Switched from dark to light*
Here is a sample of highlights that are out of date:
### What did you expect to happen?
Bufferline fully reloads its own highlights when `ColorScheme` autocmd is fired.
As workaround, I tried to manually remove old highlights and reload them as plugin does under the hood:
```lua
local all_highlights = vim.api.nvim_get_hl(0, {})
for name, _ in pairs(all_highlights) do
if name:match('^BufferLine') then
vim.api.nvim_set_hl(0, name, {})
end
end
local kfg = require('bufferline.config')
kfg.update_highlights()
```
Unfortunately this just removes highlights, but doesn't restore them.
### Config
```lua
{
'akinsho/bufferline.nvim',
version = '^4.9.1',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
---@module 'bufferline'
---@type bufferline.userconfig
opts = {
options = {
mode = 'buffers',
diagnostics = 'nvim_lsp',
offsets = {
-- possibly dapui_stacks, bapui_breakpoints, dapui_scopes, dapui_console, dap-repl
{
filetype = 'neo-tree',
text_align = 'left',
separator = true,
},
{
filetype = 'dapui_watches',
text_align = 'left',
separator = true,
},
},
},
},
init = function()
vim.opt.termguicolors = true
end,
},
```
### Additional Information
My neovim config: https://github.com/x1unix/dotfiles/tree/master/common/config/nvim
### commit
_No response_
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Evaluación
Este issue todavía no se ha evaluado.