From 3535525ad99dd3cf4e47f1571a5841883dc7c61c Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 19 Oct 2015 13:43:40 -0700 Subject: [PATCH] Don't try to reuse existing normal windows as dev mode windows --- src/browser/atom-application.coffee | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index ab7a45db9..9262068f7 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -378,14 +378,16 @@ class AtomApplication unless pidToKillWhenClosed or newWindow existingWindow = @windowForPaths(pathsToOpen, devMode) - - # Default to using the specified window or the last focused window - currentWindow = window ? @lastFocusedWindow stats = (fs.statSyncNoException(pathToOpen) for pathToOpen in pathsToOpen) - existingWindow ?= currentWindow if ( - stats.every((stat) -> stat.isFile?()) or - stats.some((stat) -> stat.isDirectory?()) and not currentWindow?.hasProjectPath() - ) + unless existingWindow? + if currentWindow = window ? @lastFocusedWindow + existingWindow = currentWindow if ( + currentWindow.devMode is devMode and + ( + stats.every((stat) -> stat.isFile?()) or + stats.some((stat) -> stat.isDirectory?() and not currentWindow.hasProjectPath()) + ) + ) if existingWindow? openedWindow = existingWindow