summaryrefslogtreecommitdiff
path: root/app-editors/atom/files/atom-fix-config-watcher-r1.patch
diff options
context:
space:
mode:
Diffstat (limited to 'app-editors/atom/files/atom-fix-config-watcher-r1.patch')
-rw-r--r--app-editors/atom/files/atom-fix-config-watcher-r1.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/app-editors/atom/files/atom-fix-config-watcher-r1.patch b/app-editors/atom/files/atom-fix-config-watcher-r1.patch
new file mode 100644
index 000000000000..7af82050d46b
--- /dev/null
+++ b/app-editors/atom/files/atom-fix-config-watcher-r1.patch
@@ -0,0 +1,41 @@
+From 5f1f840372611b8f42d8fd3be7b680f90958f015 Mon Sep 17 00:00:00 2001
+From: Elvis Pranskevichus <elvis@magic.io>
+Date: Wed, 28 Mar 2018 18:52:58 -0400
+Subject: [PATCH] Unbreak config watcher in the main process
+
+---
+ src/path-watcher.js | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/src/path-watcher.js b/src/path-watcher.js
+index 6693489ef..f3ddc6fe4 100644
+--- a/src/path-watcher.js
++++ b/src/path-watcher.js
+@@ -544,12 +544,22 @@ class PathWatcherManager {
+ // Private: Access the currently active manager instance, creating one if necessary.
+ static active () {
+ if (!this.activeManager) {
+- this.activeManager = new PathWatcherManager(atom.config.get('core.fileSystemWatcher'))
+- this.sub = atom.config.onDidChange('core.fileSystemWatcher', ({newValue}) => { this.transitionTo(newValue) })
++ let config = this.getConfig()
++ this.activeManager = new PathWatcherManager(config.get('core.fileSystemWatcher'))
++ this.sub = config.onDidChange('core.fileSystemWatcher', ({newValue}) => { this.transitionTo(newValue) })
+ }
+ return this.activeManager
+ }
+
++ // Private: get config instance for the current application
++ static getConfig() {
++ if (typeof(global.atom) != 'undefined') {
++ return global.atom.config
++ } else {
++ return global.atomApplication.config
++ }
++ }
++
+ // Private: Replace the active {PathWatcherManager} with a new one that creates [NativeWatchers]{NativeWatcher}
+ // based on the value of `setting`.
+ static async transitionTo (setting) {
+--
+2.17.0
+