File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
lua/nvim-tree/actions/tree/modifiers Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 44
44
45
45
local function gen_iterator (should_expand )
46
46
local expansion_count = 0
47
+ local function expand (node )
48
+ populate_node (node )
49
+ node = lib .get_last_group_node (node )
50
+ node .open = true
51
+ end
47
52
48
53
return function (parent )
49
- populate_node (parent )
50
- parent .open = true
54
+ if parent .parent and parent .nodes and not parent .open then
55
+ expansion_count = expansion_count + 1
56
+ expand (parent )
57
+ end
51
58
52
- Iterator .builder ({ parent } )
59
+ Iterator .builder (parent . nodes )
53
60
:hidden ()
54
61
:applier (function (node )
55
62
if should_expand (expansion_count , node , populate_node ) then
56
63
expansion_count = expansion_count + 1
57
- populate_node (node )
58
- node = lib .get_last_group_node (node )
59
- node .open = true
64
+ expand (node )
60
65
end
61
66
end )
62
67
:recursor (function (node )
You can’t perform that action at this time.
0 commit comments