@@ -42,21 +42,21 @@ local Api = {
4242}
4343
4444--- Print error when setup not called.
45- --- f function to invoke
46- --- @param f function
47- --- @return fun ( ... ) : any
48- local function wrap (f )
45+ --- @param fn fun ( ... )
46+ --- @return fun ( ... )
47+ local function wrap (fn )
4948 return function (...)
5049 if vim .g .NvimTreeSetup == 1 then
51- return f (... )
50+ return fn (... )
5251 else
5352 notify .error (" nvim-tree setup not called" )
5453 end
5554 end
5655end
5756
5857--- Inject the node as the first argument if present otherwise do nothing.
59- --- @param fn function function to invoke
58+ --- @param fn fun ( node : Node , ... )
59+ --- @return fun ( node : Node , ... )
6060local function wrap_node (fn )
6161 return function (node , ...)
6262 node = node or lib .get_node_at_cursor ()
@@ -67,7 +67,8 @@ local function wrap_node(fn)
6767end
6868
6969--- Inject the node or nil as the first argument if absent.
70- --- @param fn function function to invoke
70+ --- @param fn fun ( node : Node , ... )
71+ --- @return fun ( node : Node , ... )
7172local function wrap_node_or_nil (fn )
7273 return function (node , ...)
7374 node = node or lib .get_node_at_cursor ()
@@ -211,6 +212,7 @@ local function edit(mode, node)
211212end
212213
213214--- @param mode string
215+ --- @param toggle_group boolean ?
214216--- @return fun ( node : Node )
215217local function open_or_expand_or_dir_up (mode , toggle_group )
216218 --- @param node Node
@@ -286,7 +288,7 @@ Api.config.mappings.default_on_attach = keymap.default_on_attach
286288Api .diagnostics .hi_test = wrap (appearance_diagnostics .hi_test )
287289
288290Api .commands .get = wrap (function ()
289- return require (" nvim-tree.commands" ).get ()
291+ require (" nvim-tree.commands" ).get ()
290292end )
291293
292294return Api
0 commit comments