Skip to content

Commit

Permalink
Delay file removal to fix vim backupcopy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
es128 committed Oct 1, 2013
1 parent 7412fab commit cc7ca22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ exports.FSWatcher = class FSWatcher extends EventEmitter
.filter (file) =>
current.indexOf(file) is -1
.forEach (file) =>
@_remove directory, file
fullPath = sysPath.join directory, file
setTimeout =>
fs.exists fullPath, (exists) =>
if exists
@_handle fullPath, false
else
@_remove directory, file
, 50

# Files that present in current directory snapshot
# but absent in previous are added to watch list and
Expand Down

0 comments on commit cc7ca22

Please sign in to comment.