diff --git a/lua/nvim-tree/actions/tree/modifiers/expand.lua b/lua/nvim-tree/actions/tree/modifiers/expand.lua index fcd1a4ab..16c9b9f8 100644 --- a/lua/nvim-tree/actions/tree/modifiers/expand.lua +++ b/lua/nvim-tree/actions/tree/modifiers/expand.lua @@ -44,7 +44,7 @@ end ---@param expansion_count integer ---@param node Node ----@param should_descend fun(expansion_count: integer, node: DirectoryNode): boolean +---@param should_descend fun(expansion_count: integer, node: Node): boolean ---@return boolean local function should_expand(expansion_count, node, should_descend) local dir = node:as(DirectoryNode) @@ -52,7 +52,7 @@ local function should_expand(expansion_count, node, should_descend) return false end - if not dir.open and should_descend(expansion_count, dir) then + if not dir.open and should_descend(expansion_count, node) then core.get_explorer():expand(dir) -- populate node.group_next if dir.group_next then return should_expand(expansion_count, dir.group_next, should_descend) @@ -64,7 +64,7 @@ local function should_expand(expansion_count, node, should_descend) end ----@param should_descend fun(expansion_count: integer, node: DirectoryNode): boolean +---@param should_descend fun(expansion_count: integer, node: Node): boolean ---@return fun(node): any local function gen_iterator(should_descend) local expansion_count = 0 diff --git a/lua/nvim-tree/api.lua b/lua/nvim-tree/api.lua index 059101df..27f819ff 100644 --- a/lua/nvim-tree/api.lua +++ b/lua/nvim-tree/api.lua @@ -188,7 +188,7 @@ Api.tree.search_node = wrap(actions.finders.search_node.fn) Api.tree.collapse_all = wrap(actions.tree.modifiers.collapse.all) ---@class ApiTreeExpandOpts ----@field expand_until (fun(expansion_count: integer, node: DirectoryNode): boolean)|nil +---@field expand_until (fun(expansion_count: integer, node: Node): boolean)|nil Api.tree.expand_all = wrap_node(actions.tree.modifiers.expand.all) Api.tree.toggle_enable_filters = wrap_explorer_member("filters", "toggle")