File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -281,9 +281,15 @@ All commands execute public API.
281281
282282 require("nvim-tree.api").health.hi_test()
283283<
284- *:NvimTreeResize*
284+ *:NvimTreeResize* | nvim_tree.api.tree.resize() | >lua
285285
286- Columns integer argument is absolute (e.g. `40 ` ) or a delta (e.g. `-5 ` , `+ 5 ` )
286+ local sign = c.args:sub(1, 1)
287+ if sign == "+" or sign == "-" then
288+ require("nvim-tree.api").tree.resize({ relative = tonumber(c.args) })
289+ else
290+ require("nvim-tree.api").tree.resize({ absolute = tonumber(c.args) })
291+ end
292+ <
287293
288294==============================================================================
289295Setup *nvim-tree-setup*
Original file line number Diff line number Diff line change @@ -109,7 +109,12 @@ local CMDS = {
109109 bar = true ,
110110 },
111111 command = function (c )
112- require (" nvim-tree.view" ).resize (c .args )
112+ local sign = c .args :sub (1 , 1 )
113+ if sign == " +" or sign == " -" then
114+ require (" nvim-tree.api" ).tree .resize ({ relative = tonumber (c .args ) })
115+ else
116+ require (" nvim-tree.api" ).tree .resize ({ absolute = tonumber (c .args ) })
117+ end
113118 end ,
114119 },
115120 {
You can’t perform that action at this time.
0 commit comments