@@ -125,7 +125,7 @@ function Explorer:reload(node, git_status)
125
125
})
126
126
127
127
while true do
128
- local name , _ = vim .loop .fs_scandir_next (handle )
128
+ local name , t = vim .loop .fs_scandir_next (handle )
129
129
if not name then
130
130
break
131
131
end
@@ -138,14 +138,11 @@ function Explorer:reload(node, git_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 type = stat and stat .type or nil
143
-
144
141
-- Recreate node if type changes.
145
142
if nodes_by_path [abs ] then
146
143
local n = nodes_by_path [abs ]
147
144
148
- if n .type ~= type then
145
+ if n .type ~= t then
149
146
utils .array_remove (node .nodes , n )
150
147
explorer_node .node_destroy (n )
151
148
nodes_by_path [abs ] = nil
@@ -154,11 +151,11 @@ function Explorer:reload(node, git_status)
154
151
155
152
if not nodes_by_path [abs ] then
156
153
local new_child = nil
157
- if type == " directory" and vim .loop .fs_access (abs , " R" ) and Watcher .is_fs_event_capable (abs ) then
154
+ if t == " directory" and vim .loop .fs_access (abs , " R" ) and Watcher .is_fs_event_capable (abs ) then
158
155
new_child = builders .folder (node , abs , name , stat )
159
- elseif type == " file" then
156
+ elseif t == " file" then
160
157
new_child = builders .file (node , abs , name , stat )
161
- elseif type == " link" then
158
+ elseif t == " link" then
162
159
local link = builders .link (node , abs , name , stat )
163
160
if link .link_to ~= nil then
164
161
new_child = link
0 commit comments