@@ -122,22 +122,19 @@ function Explorer:reload(node, git_status)
122122 if filter_reason == FILTER_REASON .none then
123123 remain_childs [abs ] = true
124124
125- -- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
126- local t = stat and stat .type or nil
127-
128125 -- Recreate node if type changes.
129126 if nodes_by_path [abs ] then
130127 local n = nodes_by_path [abs ]
131128
132- if n .type ~= t then
129+ if not stat or n .type ~= stat . type then
133130 utils .array_remove (node .nodes , n )
134131 n :destroy ()
135132 nodes_by_path [abs ] = nil
136133 end
137134 end
138135
139136 if not nodes_by_path [abs ] then
140- local new_child = node_factory .create_node (self , node , abs , t , stat , name )
137+ local new_child = node_factory .create_node (self , node , abs , stat , name )
141138 if new_child then
142139 table.insert (node .nodes , new_child )
143140 nodes_by_path [abs ] = new_child
@@ -276,9 +273,7 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
276273 local stat = vim .loop .fs_lstat (abs )
277274 local filter_reason = parent .filters :should_filter_as_reason (abs , stat , filter_status )
278275 if filter_reason == FILTER_REASON .none and not nodes_by_path [abs ] then
279- -- Type must come from fs_stat and not fs_scandir_next to maintain sshfs compatibility
280- local t = stat and stat .type or nil
281- local child = node_factory .create_node (self , node , abs , t , stat , name )
276+ local child = node_factory .create_node (self , node , abs , stat , name )
282277 if child then
283278 table.insert (node .nodes , child )
284279 nodes_by_path [child .absolute_path ] = true
0 commit comments