From 160ae4fce6e91ac7b8d12417145478c19e3f042e Mon Sep 17 00:00:00 2001 From: ghostbuster91 Date: Sat, 2 Aug 2025 16:13:07 +0200 Subject: [PATCH] Fix lint error --- lua/nvim-tree/actions/tree/modifiers/expand.lua | 12 ++++++------ lua/nvim-tree/api.lua | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/nvim-tree/actions/tree/modifiers/expand.lua b/lua/nvim-tree/actions/tree/modifiers/expand.lua index 8b897251..fcd1a4ab 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: Node): boolean +---@param should_descend fun(expansion_count: integer, node: DirectoryNode): boolean ---@return boolean local function should_expand(expansion_count, node, should_descend) local dir = node:as(DirectoryNode) @@ -52,10 +52,10 @@ local function should_expand(expansion_count, node, should_descend) return false end - if not dir.open and should_descend(expansion_count, node) then - core.get_explorer():expand(node) - if node.group_next then - return should_expand(expansion_count, node.group_next, should_descend) + if not dir.open and should_descend(expansion_count, dir) 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) else return true end @@ -64,7 +64,7 @@ local function should_expand(expansion_count, node, should_descend) end ----@param should_descend fun(expansion_count: integer, node: Node): boolean +---@param should_descend fun(expansion_count: integer, node: DirectoryNode): 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 27f819ff..059101df 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: Node): boolean)|nil +---@field expand_until (fun(expansion_count: integer, node: DirectoryNode): boolean)|nil Api.tree.expand_all = wrap_node(actions.tree.modifiers.expand.all) Api.tree.toggle_enable_filters = wrap_explorer_member("filters", "toggle")