Electron: Fixes #710: Don't unwatch file when it is temporarily deleted

pull/550/merge
Laurent Cozic 2018-09-13 19:29:48 +01:00
parent 38970e9a52
commit 0a5ad1d628
1 changed files with 7 additions and 1 deletions

View File

@ -44,7 +44,13 @@ class ExternalEditWatcher {
this.logger().debug('ExternalEditWatcher: Event: ' + event + ': ' + path);
if (event === 'unlink') {
this.watcher_.unwatch(path);
// File are unwatched in the stopWatching functions below. When we receive an unlink event
// here it might be that the file is quickly moved to a different location and replaced by
// another file with the same name, as it happens with emacs. So because of this
// we keep watching anyway.
// See: https://github.com/laurent22/joplin/issues/710#issuecomment-420997167
// this.watcher_.unwatch(path);
} else if (event === 'change') {
const id = Note.pathToId(path);