fix: decrease win_width instead of increasing text_width when computing condition for full name float to show

This commit is contained in:
Šimon Mandlík 2025-05-18 11:20:38 +02:00
parent 6656d82d63
commit 56ba24bee3
No known key found for this signature in database

View File

@ -56,7 +56,7 @@ local function show(opts)
-- windows width reduced by right aligned icons -- windows width reduced by right aligned icons
local icon_ns_id = vim.api.nvim_get_namespaces()["NvimTreeExtmarks"] local icon_ns_id = vim.api.nvim_get_namespaces()["NvimTreeExtmarks"]
local icon_extmarks = vim.api.nvim_buf_get_extmarks(0, icon_ns_id, { line_nr - 1, 0 }, { line_nr - 1, -1 }, { details = true }) local icon_extmarks = vim.api.nvim_buf_get_extmarks(0, icon_ns_id, { line_nr - 1, 0 }, { line_nr - 1, -1 }, { details = true })
text_width = text_width + utils.extmarks_length(icon_extmarks) win_width = win_width - utils.extmarks_length(icon_extmarks)
if text_width < win_width then if text_width < win_width then
return return