Skip to content

Commit e66994d

Browse files
authored
fix: incorrect window width when right_align icons present (#3239)
fix: correctly assign extmarks to lines when computing tree window width in `grow` when `nvim-tree.view.width.lines_excluded` contains "root"
1 parent b8b44b6 commit e66994d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/nvim-tree/view.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,8 @@ local function grow()
325325
end
326326

327327
local ns_id = vim.api.nvim_get_namespaces()["NvimTreeExtmarks"]
328-
for line_nr, l in pairs(lines) do
328+
for i, l in pairs(lines) do
329+
local line_nr = starts_at + i - 1
329330
local line_width = vim.fn.strchars(l)
330331
-- also add space for right-aligned icons
331332
local extmarks = vim.api.nvim_buf_get_extmarks(M.get_bufnr(), ns_id, { line_nr, 0 }, { line_nr, -1 }, { details = true })

0 commit comments

Comments
 (0)