nvim-cokeline
nvim-cokeline copied to clipboard
Component hightlight doesn't update after colorscheme change
The buffer-tab component hightlights (except for default hl) are not changed after colorscheme highlight change.
Noticable after switching between dark and light schemes
Just to add I get around this by having a ColorScheme
autocommand that reloads my cokeline config.
I had the same issue, but then I noticed that I had created all components outside of the require('cokeline').setup
call. Remember to update all the components too in order to update all colors.
I implemented a temporary fix by mapping a key to source the cokeline config file, so every time I change the theme I manually refresh the cokeline colors. Simple workaround for now.
What olimorris mentioned is actually a way better solution, here's how I did it.
local group = vim.api.nvim_create_augroup("CokeLine Fix", { clear = true }) -- A group with clear on true is created so that the autocmd isn't being duplicated on every run in the :autocmd ColorScheme list
vim.api.nvim_create_autocmd("ColorScheme",
{ command = "source ~/.config/nvim/PUT_YOUR_PATH_TO_COKELINE_CONFIG_HERE.lua", group = group })
Paste this anywhere in the CokeLine config, set the path, and it'll be registered.
Should be fixed, I can't repro anymore and just added the ability to return hlgroup names instead of hex colors to read the color from a predefined hlgroup.