diff --git a/lua/nvim-tree.lua b/lua/nvim-tree.lua index 3eec3114..b87a2e48 100644 --- a/lua/nvim-tree.lua +++ b/lua/nvim-tree.lua @@ -192,6 +192,7 @@ end function M.reset_highlight() colors.setup() + view.reset_winhl() renderer.render_hl(view.get_bufnr()) end diff --git a/lua/nvim-tree/view.lua b/lua/nvim-tree/view.lua index eb38b015..9df2e3ab 100644 --- a/lua/nvim-tree/view.lua +++ b/lua/nvim-tree/view.lua @@ -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