diff --git a/ReactNativeClient/lib/services/ExternalEditWatcher.js b/ReactNativeClient/lib/services/ExternalEditWatcher.js index bd5365f0992..4632f54758b 100644 --- a/ReactNativeClient/lib/services/ExternalEditWatcher.js +++ b/ReactNativeClient/lib/services/ExternalEditWatcher.js @@ -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; \ No newline at end of file +module.exports = ExternalEditWatcher;