From 896ebfd97d36a425fd44153ebdf8d9d8864f266c Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Sun, 28 Apr 2019 17:22:14 -0400 Subject: [PATCH] Skip spec windows when finding an existing window to open paths --- src/main-process/atom-application.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main-process/atom-application.js b/src/main-process/atom-application.js index 4224dba69..6ff38b9ed 100644 --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js @@ -866,6 +866,7 @@ class AtomApplication extends EventEmitter { // Returns the {AtomWindow} for the given locations. windowForLocations (locationsToOpen, devMode, safeMode) { return this.getLastFocusedWindow(window => + !window.isSpec && window.devMode === devMode && window.safeMode === safeMode && window.containsLocations(locationsToOpen) @@ -1021,13 +1022,13 @@ class AtomApplication extends EventEmitter { // focused window that matches the requested dev and safe modes. if (!existingWindow && addToLastWindow) { existingWindow = this.getLastFocusedWindow(win => { - return win.devMode === devMode && win.safeMode === safeMode + return !win.isSpec && win.devMode === devMode && win.safeMode === safeMode }) } // Fall back to the last focused window that has no project roots. if (!existingWindow) { - existingWindow = this.getLastFocusedWindow(win => !win.hasProjectPaths()) + existingWindow = this.getLastFocusedWindow(win => !win.isSpec && !win.hasProjectPaths()) } // One last case: if *no* paths are directories, add to the last focused window. @@ -1035,7 +1036,7 @@ class AtomApplication extends EventEmitter { const noDirectories = locationsToOpen.every(location => !location.isDirectory) if (noDirectories) { existingWindow = this.getLastFocusedWindow(win => { - return win.devMode === devMode && win.safeMode === safeMode + return !win.isSpec && win.devMode === devMode && win.safeMode === safeMode }) } }