Skip to content

Commit bde9b46

Browse files
committed
fix: extra namespace added to avoid colision between right_align and full_name features
1 parent a8873b8 commit bde9b46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/nvim-tree/renderer/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ local M = {}
1313
local SIGN_GROUP = "NvimTreeRendererSigns"
1414

1515
local namespace_id = vim.api.nvim_create_namespace "NvimTreeHighlights"
16+
local namespace_extmarks_id = vim.api.nvim_create_namespace "NvimTreeExtmarks"
1617

1718
---@param bufnr number
1819
---@param lines string[]
@@ -38,9 +39,11 @@ local function _draw(bufnr, lines, hl_args, signs, extmarks)
3839
for i, sign_name in pairs(signs) do
3940
vim.fn.sign_place(0, SIGN_GROUP, sign_name, bufnr, { lnum = i + 1 })
4041
end
42+
43+
vim.api.nvim_buf_clear_namespace(bufnr, namespace_extmarks_id, 0, -1)
4144
for i, extname in pairs(extmarks) do
4245
for _, mark in ipairs(extname) do
43-
vim.api.nvim_buf_set_extmark(bufnr, namespace_id, i, -1, {
46+
vim.api.nvim_buf_set_extmark(bufnr, namespace_extmarks_id, i, -1, {
4447
virt_text = { { mark.str, mark.hl } },
4548
virt_text_pos = "right_align",
4649
hl_mode = "combine",

0 commit comments

Comments
 (0)