File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
lua/nvim-tree/actions/tree/modifiers Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 28
28
29
29
--- @param expansion_count integer
30
30
--- @param node Node
31
- --- @return boolean
31
+ --- @return boolean , function
32
32
local function expand_until_max_or_empty (expansion_count , node )
33
33
local should_halt = expansion_count >= M .MAX_FOLDER_DISCOVERY
34
34
local should_exclude = M .EXCLUDE [node .name ]
35
- return not should_halt and node .nodes and not node .open and not should_exclude
35
+ local result = not should_halt and node .nodes and not node .open and not should_exclude
36
+ return result , expand_until_max_or_empty
36
37
end
37
38
38
- local function gen_iterator (should_expand )
39
+ local function gen_iterator (should_expand_fn )
39
40
local expansion_count = 0
40
41
41
42
return function (parent )
@@ -47,7 +48,9 @@ local function gen_iterator(should_expand)
47
48
Iterator .builder (parent .nodes )
48
49
:hidden ()
49
50
:applier (function (node )
50
- if should_expand (expansion_count , node ) then
51
+ local should_expand , should_expand_next_fn = should_expand_fn (expansion_count , node )
52
+ should_expand_fn = should_expand_next_fn
53
+ if should_expand then
51
54
expansion_count = expansion_count + 1
52
55
expand (node )
53
56
end
You can’t perform that action at this time.
0 commit comments