I'm using a config based on kickstart, which uses lazy.vim. It apparently loads the plugins before vim sets vim.o.background by reading it from the terminal. This means when the vscode plugin gets loaded it reads background's default value of 'dark', and by writing this back to vim.o.background it seems to disable vim's subsequent autodetection, so it always gets forced to 'dark' even if the terminal has a light background.
If I disable the line vim.o.background = ... in the plugin's init.lua, auto-detection works correctly. Please could you consider changing it? The code below seems to work for me, and should also work for anyone who relied on the old behavior.
local background = style or config.opts.style
if background and background ~= vim.o.background then
vim.o.background = background
end
I'm using a config based on kickstart, which uses lazy.vim. It apparently loads the plugins before vim sets
vim.o.background
by reading it from the terminal. This means when the vscode plugin gets loaded it readsbackground
's default value of 'dark', and by writing this back tovim.o.background
it seems to disable vim's subsequent autodetection, so it always gets forced to 'dark' even if the terminal has a light background.If I disable the line
vim.o.background = ...
in the plugin'sinit.lua
, auto-detection works correctly. Please could you consider changing it? The code below seems to work for me, and should also work for anyone who relied on the old behavior.