Skip to content

Commit 0a2c460

Browse files
committed
full-name uses one and only namespace
1 parent 82e1ac8 commit 0a2c460

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lua/nvim-tree.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ local function setup_autocommands(opts)
162162
vim.api.nvim_create_autocmd(name, vim.tbl_extend("force", default_opts, custom_opts))
163163
end
164164

165-
-- reset and draw highlights when appearancecheme is changed
166-
create_nvim_tree_autocmd("appearancecheme", {
165+
-- reset and draw highlights when colorscheme is changed
166+
create_nvim_tree_autocmd("ColorScheme", {
167167
callback = function()
168168
appearance.setup()
169169
renderer.render_hl(view.get_bufnr())

lua/nvim-tree/renderer/components/full-name.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local appearance = require "nvim-tree.appearance"
2+
13
local M = {}
24

35
local utils = require "nvim-tree.utils"
@@ -66,13 +68,12 @@ local function show()
6668
style = "minimal",
6769
})
6870

69-
local ns_id = vim.api.nvim_get_namespaces()["NvimTreeHighlights"]
70-
local extmarks = vim.api.nvim_buf_get_extmarks(0, ns_id, { line_nr - 1, 0 }, { line_nr - 1, -1 }, { details = 1 })
71+
local extmarks = vim.api.nvim_buf_get_extmarks(0, appearance.NS_ID, { line_nr - 1, 0 }, { line_nr - 1, -1 }, { details = 1 })
7172
vim.api.nvim_win_call(M.popup_win, function()
7273
vim.api.nvim_buf_set_lines(0, 0, -1, true, { line })
7374
for _, extmark in ipairs(extmarks) do
7475
local hl = extmark[4]
75-
vim.api.nvim_buf_add_highlight(0, ns_id, hl.hl_group, 0, extmark[3], hl.end_col)
76+
vim.api.nvim_buf_add_highlight(0, appearance.NS_ID, hl.hl_group, 0, extmark[3], hl.end_col)
7677
end
7778
vim.cmd [[ setlocal nowrap cursorline noswapfile nobuflisted buftype=nofile bufhidden=hide ]]
7879
end)

0 commit comments

Comments
 (0)