Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dastrus opened this issue Dec 7, 2023 · 2 comments
Open

Comments

@dastrus
Copy link

dastrus commented Dec 7, 2023

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
Copy link

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

@alexeevit
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants