@@ -241,17 +241,17 @@ function Explorer:refresh_parent_nodes_for_path(path)
241
241
-- collect parent nodes from the top down
242
242
local parent_nodes = {}
243
243
NodeIterator .builder ({ self })
244
- :recursor (function (node )
245
- return node .nodes
246
- end )
247
- :applier (function (node )
248
- local abs_contains = node .absolute_path and path :find (node .absolute_path , 1 , true ) == 1
249
- local link_contains = node .link_to and path :find (node .link_to , 1 , true ) == 1
250
- if abs_contains or link_contains then
251
- table.insert (parent_nodes , node )
252
- end
253
- end )
254
- :iterate ()
244
+ :recursor (function (node )
245
+ return node .nodes
246
+ end )
247
+ :applier (function (node )
248
+ local abs_contains = node .absolute_path and path :find (node .absolute_path , 1 , true ) == 1
249
+ local link_contains = node .link_to and path :find (node .link_to , 1 , true ) == 1
250
+ if abs_contains or link_contains then
251
+ table.insert (parent_nodes , node )
252
+ end
253
+ end )
254
+ :iterate ()
255
255
256
256
-- refresh in order; this will expand groups as needed
257
257
for _ , node in ipairs (parent_nodes ) do
@@ -369,13 +369,13 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
369
369
local filter_reason = parent .filters :should_filter_as_reason (abs , stat , filter_status )
370
370
if filter_reason == FILTER_REASON .none and not nodes_by_path [abs ] then
371
371
-- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
372
- local type = stat and stat .type or nil
372
+ local t = stat and stat .type or nil
373
373
local child = nil
374
- if type == " directory" and vim .loop .fs_access (abs , " R" ) then
374
+ if t == " directory" and vim .loop .fs_access (abs , " R" ) then
375
375
child = builders .folder (node , abs , name , stat )
376
- elseif type == " file" then
376
+ elseif t == " file" then
377
377
child = builders .file (node , abs , name , stat )
378
- elseif type == " link" then
378
+ elseif t == " link" then
379
379
local link = builders .link (node , abs , name , stat )
380
380
if link .link_to ~= nil then
381
381
child = link
@@ -439,16 +439,16 @@ end
439
439
--- @param projects table
440
440
function Explorer :refresh_nodes (projects )
441
441
Iterator .builder ({ self })
442
- :applier (function (n )
443
- if n .nodes then
444
- local toplevel = git .get_toplevel (n .cwd or n .link_to or n .absolute_path )
445
- self :reload (n , projects [toplevel ] or {})
446
- end
447
- end )
448
- :recursor (function (n )
449
- return n .group_next and { n .group_next } or (n .open and n .nodes )
450
- end )
451
- :iterate ()
442
+ :applier (function (n )
443
+ if n .nodes then
444
+ local toplevel = git .get_toplevel (n .cwd or n .link_to or n .absolute_path )
445
+ self :reload (n , projects [toplevel ] or {})
446
+ end
447
+ end )
448
+ :recursor (function (n )
449
+ return n .group_next and { n .group_next } or (n .open and n .nodes )
450
+ end )
451
+ :iterate ()
452
452
end
453
453
454
454
local event_running = false
0 commit comments