fix(colorscheme): update winhl on colorscheme change

fixes #1696
This commit is contained in:
kiyan 2022-10-28 14:19:01 +02:00
parent 1be1e17be5
commit 65c2ba8952
2 changed files with 8 additions and 0 deletions

View File

@ -192,6 +192,7 @@ end
function M.reset_highlight()
colors.setup()
view.reset_winhl()
renderer.render_hl(view.get_bufnr())
end

View File

@ -436,6 +436,13 @@ function M.is_root_folder_visible(cwd)
return cwd ~= "/" and not M.View.hide_root_folder
end
-- used on ColorScheme event
function M.reset_winhl()
if M.get_winnr() then
vim.wo[M.get_winnr()].winhl = M.View.winopts.winhl
end
end
function M.setup(opts)
local options = opts.view or {}
M.View.adaptive_size = options.adaptive_size