@@ -125,19 +125,22 @@ function Explorer:reload(node, git_status)
125
125
})
126
126
127
127
while true do
128
- local name , t = vim .loop .fs_scandir_next (handle )
128
+ local name , _ = vim .loop .fs_scandir_next (handle )
129
129
if not name then
130
130
break
131
131
end
132
132
133
133
local abs = utils .path_join { cwd , name }
134
134
--- @type uv.fs_stat.result | nil
135
- local stat = vim .loop .fs_stat (abs )
135
+ local stat = vim .loop .fs_lstat (abs )
136
136
137
137
local filter_reason = self .filters :should_filter_as_reason (abs , stat , filter_status )
138
138
if filter_reason == FILTER_REASON .none then
139
139
remain_childs [abs ] = true
140
140
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
+
141
144
-- Recreate node if type changes.
142
145
if nodes_by_path [abs ] then
143
146
local n = nodes_by_path [abs ]
@@ -351,7 +354,7 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
351
354
})
352
355
353
356
while true do
354
- local name , t = vim .loop .fs_scandir_next (handle )
357
+ local name , _ = vim .loop .fs_scandir_next (handle )
355
358
if not name then
356
359
break
357
360
end
@@ -362,9 +365,11 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
362
365
local profile = log .profile_start (" populate_children %s" , abs )
363
366
364
367
--- @type uv.fs_stat.result | nil
365
- local stat = vim .loop .fs_stat (abs )
368
+ local stat = vim .loop .fs_lstat (abs )
366
369
local filter_reason = parent .filters :should_filter_as_reason (abs , stat , filter_status )
367
370
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
368
373
local child = nil
369
374
if t == " directory" and vim .loop .fs_access (abs , " R" ) then
370
375
child = builders .folder (node , abs , name , stat )
0 commit comments