File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
lua/neo-tree/sources/filesystem/lib Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -481,6 +481,22 @@ local handle_refresh_or_up = function (context, async)
481481 elseif state .tree then
482482 context .paths_to_load = renderer .get_expanded_nodes (state .tree , state .path )
483483 end
484+ -- Ensure parents of all expanded nodes are also scanned
485+ if # context .paths_to_load > 0 and state .tree then
486+ local seen = {}
487+ for _ , p in ipairs (context .paths_to_load ) do
488+ local current = p
489+ while current do
490+ if seen [current ] then
491+ break
492+ end
493+ seen [current ] = true
494+ local current_node = state .tree :get_node (current )
495+ current = current_node and current_node :get_parent_id ()
496+ end
497+ end
498+ context .paths_to_load = vim .tbl_keys (seen )
499+ end
484500 -- Ensure that there are no nested files in the list of folders to load
485501 context .paths_to_load = vim .tbl_filter (function (p )
486502 local stats = vim .loop .fs_stat (p )
You can’t perform that action at this time.
0 commit comments