You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-08-13 22:12:50 +02:00
Desktop: Fixed issue with issue with watching file on Linux (#1659)
Watch for rename events in the external editor and re-watch file
This commit is contained in:
committed by
Laurent Cozic
parent
3819897ba1
commit
b461625518
@@ -87,6 +87,14 @@ class ExternalEditWatcher {
|
||||
this.logger().error(error)
|
||||
}
|
||||
});
|
||||
// Hack to support external watcher on some linux applications (gedit, gvim, etc)
|
||||
// taken from https://github.com/paulmillr/chokidar/issues/591
|
||||
this.watcher_.on('raw', async (event, path, {watchedPath}) => {
|
||||
if (event === 'rename') {
|
||||
this.watcher_.unwatch(watchedPath);
|
||||
this.watcher_.add(watchedPath);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.watcher_.add(fileToWatch);
|
||||
}
|
||||
@@ -297,4 +305,4 @@ class ExternalEditWatcher {
|
||||
|
||||
}
|
||||
|
||||
module.exports = ExternalEditWatcher;
|
||||
module.exports = ExternalEditWatcher;
|
||||
|
Reference in New Issue
Block a user