@@ -125,7 +125,7 @@ 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
@@ -138,11 +138,14 @@ function Explorer:reload(node, git_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 type = 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 ]
144147
145- if n .type ~= t then
148+ if n .type ~= type then
146149 utils .array_remove (node .nodes , n )
147150 explorer_node .node_destroy (n )
148151 nodes_by_path [abs ] = nil
@@ -151,11 +154,11 @@ function Explorer:reload(node, git_status)
151154
152155 if not nodes_by_path [abs ] then
153156 local new_child = nil
154- if t == " directory" and vim .loop .fs_access (abs , " R" ) and Watcher .is_fs_event_capable (abs ) then
157+ if type == " directory" and vim .loop .fs_access (abs , " R" ) and Watcher .is_fs_event_capable (abs ) then
155158 new_child = builders .folder (node , abs , name , stat )
156- elseif t == " file" then
159+ elseif type == " file" then
157160 new_child = builders .file (node , abs , name , stat )
158- elseif t == " link" then
161+ elseif type == " link" then
159162 local link = builders .link (node , abs , name , stat )
160163 if link .link_to ~= nil then
161164 new_child = link
0 commit comments