Open boltlessengineer opened 1 year ago
hmm I'm sorry but I can't reproduce. Do you have any plugins that interact with the winbar?
sorry, I was indeed able to reproduce, like 1 out of 10 restarts does not apply the winbar override... I really wouldn't know how to debug this...
But you don't need to use override at all... I wonder if this could be reproduced with the following snippet
require'kanagawa'.setup({...})
vim.cmd("colorscheme kanagawa")
vim.cmd("hi WinBar guibg=gray")
vim.cmd("hi WinBarNC guibg=black")
This solved the problem right away.
Lovely theme by the way. I really admire the dragon variant, I love the old terminal look that it provides, it makes it seem like I'm using Bram's old vim again, unlike the contemporary hipster garbage like catpucchin and a few others.
The problem is here: https://github.com/rebelot/kanagawa.nvim/blob/master/lua/kanagawa/highlights/editor.lua#L142-L145
There is a WinBar
(correct case) and Winbar
(not correct case), so when you do override (properly), there are appear 2 records in the lua table, and I guess they are applied with some randomness.
I have totally same story with Statusline
and StatusLine
, actually having Statusline
as not correct override in local config.
IMO this is coming from the fact that despite highlights are case-sensitive e.g. StatusLine
I can do hi sTaTusLine guibg=#123456
and it will apply it to the StatusLine
existing highlight, not creating new highlight and/or raising error.
Which ^^^ totally explains "random" behaviour.
In my case after appying proper case, all randomness have gone as it was my config bug. For WinBar
this needs a code fix, as it is bug in the repo.
Except fixing the bug, maybe worth checking repo as there might be similar wrong case occurances somewhere
As well maybe override
method need to be more robust to handle even wrong cases vs creating 2 rows in the table. At least it might print warning message on load for such, which is not hard.
I found overriding
WinBar
highlighting group works randomly. Even I overrideWinBar
to{ bg = '#000000' }
,WinBar
hlgroup appears to be{ fg = '#c8c093' }
most cases.How to reproduce:
test.lua
file (this would be minimal init.lua file)-- some keymaps for making test easy vim.keymap.set('n', '', function() vim.o.winbar = [[%f]] end)
vim.keymap.set('n', 'q', ':q')
nvim -u test.lua --no-plugin nvim -u test.lua --no-plugin nvim -u test.lua --no-plugin ...