Skip to content

Commit 4096027

Browse files
committed
rely on when resize
1 parent 54c0874 commit 4096027

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/nvim-tree/actions/tree/resize.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ function M.fn(opts)
3434

3535
local relative = options.relative
3636
if type(relative) == "number" then
37-
local new_size = view.get_width() + relative
38-
view.resize(new_size)
37+
local relative_size = tostring(relative)
38+
if relative > 0 then
39+
relative_size = "+" .. relative_size
40+
end
41+
42+
view.resize(relative_size)
3943
return
4044
end
4145
end

0 commit comments

Comments
 (0)