qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.67k stars 219 forks source link

Setting the `background` option eventually messes up the `Normal` highlight. #1030

Open dastrus opened 11 months ago

dastrus commented 11 months ago

This is the everforest theme with background=dark.

image

If I set background=light then I get this:

image

Both of these are correct.

Now, if I set background=dark, I get this:

image

And set background=light gives me this:

image

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
alexeevit commented 9 months ago

Have same problem, I use f-person/auto-dark-mode.nvim and it breaks the colors in dark mode

alexeevit commented 8 months ago

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 + -).