Skip to content

Commit cde93f3

Browse files
committed
don't highlight fast, just apply to namespace, safer win_set_hl
1 parent 0a2c460 commit cde93f3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

lua/nvim-tree/appearance.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function M.setup()
208208
vim.api.nvim_command("hi def link " .. from .. " " .. to)
209209
end
210210

211-
-- window namespace; these don't appear to be cleared on colorscheme however err on the side of caution
211+
-- window standard; this doesn't appear to clear on ColorScheme however we err on the side of caution
212212
for from, to in pairs(NS_LINKS) do
213213
vim.api.nvim_set_hl(M.NS_ID, from, { link = to })
214214
end

lua/nvim-tree/renderer/builder.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,6 @@ function Builder:_create_combined_group(groups)
283283
end
284284

285285
-- highlight directly in the namespace
286-
vim.api.nvim_set_hl_ns_fast(appearance.NS_ID)
287286
vim.api.nvim_set_hl(appearance.NS_ID, combined_name, combined_hl)
288287

289288
table.insert(self.combined_groups, combined_name)

lua/nvim-tree/view.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ local function set_window_options_and_buffer()
135135
vim.opt_local[k] = v
136136
end
137137
vim.opt.eventignore = eventignore
138-
vim.api.nvim_win_set_hl_ns(0, appearance.NS_ID)
138+
139+
-- use highlights from the nvim_tree namespace
140+
vim.api.nvim_win_set_hl_ns(M.get_winnr(), appearance.NS_ID)
139141
end
140142

141143
---@return table

0 commit comments

Comments
 (0)