Skip to content

Commit 4d748ef

Browse files
authored
fix(fs_actions): clear buffers when trashing (#2036)
1 parent 8f858a7 commit 4d748ef

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lua/neo-tree/sources/filesystem/lib/fs_actions.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ M.trash_node = function(path, callback, state)
801801
if state and restorefunc then
802802
table.insert(state.undostack, restorefunc)
803803
end
804+
clear_buffer(path)
804805
internal_hooks.on_file_deleted(path, callback)
805806
end)
806807
end
@@ -824,6 +825,12 @@ M.trash_nodes = function(paths, callback, state)
824825
table.insert(state.undostack, restorefunc)
825826
end
826827

828+
for _, path in ipairs(paths) do
829+
if not uv.fs_lstat(path) then
830+
clear_buffer(path)
831+
end
832+
end
833+
827834
internal_hooks.on_files_trashed(paths, callback)
828835
end)
829836
end

0 commit comments

Comments
 (0)