Skip to content

Commit c83406b

Browse files
committed
stop file watch when trashed folders error on windows
1 parent d824ed1 commit c83406b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ end
4242
---@param path string
4343
function Watcher:start(path)
4444
if not self.active then
45-
self.handle:start(path, flags, self.callback)
45+
self.handle:start(path, flags, function(err, fname)
46+
if err == "EPERM" then
47+
self:stop()
48+
end
49+
self.callback(err, fname)
50+
end)
4651
self.active = true
4752
end
4853
end

0 commit comments

Comments
 (0)