Skip to content

Commit 57af3c4

Browse files
committed
Try to minimize the changes
1 parent 06aad16 commit 57af3c4

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lua/nvim-tree/actions/tree/modifiers/expand-all.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ local function expand_until_max_or_empty(expansion_count, node)
4242
return not should_halt and node.nodes and not node.open and not should_exclude
4343
end
4444

45-
local function gen_iterator(should_expand_fn)
45+
local function gen_iterator(should_expand)
4646
local expansion_count = 0
4747

4848
return function(parent)
@@ -52,16 +52,15 @@ local function gen_iterator(should_expand_fn)
5252
Iterator.builder({ parent })
5353
:hidden()
5454
:applier(function(node)
55-
local should_expand = should_expand_fn(expansion_count, node, populate_node)
56-
if should_expand then
55+
if should_expand(expansion_count, node, populate_node) then
5756
expansion_count = expansion_count + 1
5857
populate_node(node)
5958
node = lib.get_last_group_node(node)
6059
node.open = true
6160
end
6261
end)
6362
:recursor(function(node)
64-
local should_recurse = should_expand_fn(expansion_count - 1, node, populate_node)
63+
local should_recurse = should_expand(expansion_count - 1, node, populate_node)
6564
return expansion_count < M.MAX_FOLDER_DISCOVERY and (should_recurse and node.open and node.nodes)
6665
end)
6766
:iterate()

0 commit comments

Comments
 (0)