@@ -125,19 +125,22 @@ function Explorer:reload(node, git_status)
125125 })
126126
127127 while true do
128- local name , t = vim .loop .fs_scandir_next (handle )
128+ local name , _ = vim .loop .fs_scandir_next (handle )
129129 if not name then
130130 break
131131 end
132132
133133 local abs = utils .path_join { cwd , name }
134134 --- @type uv.fs_stat.result | nil
135- local stat = vim .loop .fs_stat (abs )
135+ local stat = vim .loop .fs_lstat (abs )
136136
137137 local filter_reason = self .filters :should_filter_as_reason (abs , stat , filter_status )
138138 if filter_reason == FILTER_REASON .none then
139139 remain_childs [abs ] = true
140140
141+ -- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
142+ local t = stat and stat .type or nil
143+
141144 -- Recreate node if type changes.
142145 if nodes_by_path [abs ] then
143146 local n = nodes_by_path [abs ]
@@ -351,7 +354,7 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
351354 })
352355
353356 while true do
354- local name , t = vim .loop .fs_scandir_next (handle )
357+ local name , _ = vim .loop .fs_scandir_next (handle )
355358 if not name then
356359 break
357360 end
@@ -362,9 +365,11 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
362365 local profile = log .profile_start (" populate_children %s" , abs )
363366
364367 --- @type uv.fs_stat.result | nil
365- local stat = vim .loop .fs_stat (abs )
368+ local stat = vim .loop .fs_lstat (abs )
366369 local filter_reason = parent .filters :should_filter_as_reason (abs , stat , filter_status )
367370 if filter_reason == FILTER_REASON .none and not nodes_by_path [abs ] then
371+ -- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
372+ local t = stat and stat .type or nil
368373 local child = nil
369374 if t == " directory" and vim .loop .fs_access (abs , " R" ) then
370375 child = builders .folder (node , abs , name , stat )
0 commit comments