Skip to content

Commit 65c2ba8

Browse files
committed
fix(colorscheme): update winhl on colorscheme change
fixes #1696
1 parent 1be1e17 commit 65c2ba8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lua/nvim-tree.lua

+1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ end
192192

193193
function M.reset_highlight()
194194
colors.setup()
195+
view.reset_winhl()
195196
renderer.render_hl(view.get_bufnr())
196197
end
197198

lua/nvim-tree/view.lua

+7
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,13 @@ function M.is_root_folder_visible(cwd)
436436
return cwd ~= "/" and not M.View.hide_root_folder
437437
end
438438

439+
-- used on ColorScheme event
440+
function M.reset_winhl()
441+
if M.get_winnr() then
442+
vim.wo[M.get_winnr()].winhl = M.View.winopts.winhl
443+
end
444+
end
445+
439446
function M.setup(opts)
440447
local options = opts.view or {}
441448
M.View.adaptive_size = options.adaptive_size

0 commit comments

Comments
 (0)