Skip to content

Commit e80ae75

Browse files
committed
fix(#3281): fix a bug when a view width of -1 is returned from a function
1 parent 018a078 commit e80ae75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lua/nvim-tree/view.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ local function grow()
319319
end
320320

321321
local final_width = M.View.initial_width
322-
local max_width = math.huge
323-
if M.View.max_width ~= -1 then
324-
max_width = get_width(M.View.max_width)
322+
local max_width = get_width(M.View.max_width)
323+
if max_width == -1 then
324+
max_width = math.huge
325325
end
326326

327327
local ns_id = vim.api.nvim_get_namespaces()["NvimTreeExtmarks"]

0 commit comments

Comments
 (0)