Skip to content

Commit 67b344c

Browse files
committed
fix: reduce signcolumn/foldcolumn from window width
ref: `:h getwininfo()` Signed-off-by: Sabu Siyad <hello@ssiyad.com>
1 parent 1be1e17 commit 67b344c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ local function show()
3333
end
3434

3535
local width = fn.strdisplaywidth(fn.substitute(line, "[^[:print:]]*$", "", "g"))
36-
if width < fn.winwidth(0) then
36+
-- reduce signcolumn/foldcolumn from window width
37+
local win_width = fn.winwidth(0) - fn.getwininfo(fn.win_getid())[1].textoff
38+
39+
if width < win_width then
3740
return
3841
end
42+
3943
M.popup_win = api.nvim_open_win(api.nvim_create_buf(false, false), false, {
4044
relative = "win",
4145
bufpos = { fn.line "." - 2, 0 },

0 commit comments

Comments
 (0)