Setting the `background` option eventually messes up the `Normal` highlight.
dastrus opened this issue · 2 comments
This is the everforest
theme with background=dark
.
If I set background=light
then I get this:
Both of these are correct.
Now, if I set background=dark
, I get this:
And set background=light
gives me this:
If we go back to the dark version, you can see that the background is black (or something close to it). However, running the following command yields the "expected" background color:
:echo synIDattr(synIDtrans(hlID("Normal")), "bg")
#2d353b
If the window is resized at all then it fixes the colors. We can also fix them with this function:
local function fix_colors()
local bg = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID('Normal')), 'bg')
local fg = vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID('Normal')), 'fg')
vim.cmd('highlight Normal guibg=' .. bg .. ' guifg=' .. fg)
end
Version information:
VimR: 0.45.0 (20231122.130444)
NVIM v0.10.0-dev-1625+g34fa1e1ca
Build type: Release
LuaJIT 2.1.1700008891
Have same problem, I use f-person/auto-dark-mode.nvim
and it breaks the colors in dark mode
Accidentally ran into a workaround, if you press Cmd-+
(in other words cmd + shift + =
) it increases the font size and fixes the colors. Then you can change the font size back with Cmd-_
(in other words cmd + shit + -
).