Restore behavior of reusing focused window for opened files

This commit is contained in:
Max Brunsfeld
2015-02-11 17:04:54 -08:00
parent e0aa8e7f5c
commit 476876e479
3 changed files with 33 additions and 22 deletions

View File

@@ -351,9 +351,13 @@ class AtomApplication
pathsToOpen = (fs.normalize(pathToOpen) for pathToOpen in pathsToOpen)
locationsToOpen = (@locationForPathToOpen(pathToOpen) for pathToOpen in pathsToOpen)
unless pidToKillWhenClosed or newWindow # or devMode
unless pidToKillWhenClosed or newWindow
existingWindow = @windowForPaths(pathsToOpen, devMode)
# Default to using the specified window or the last focused window
if pathsToOpen.every((pathToOpen) -> fs.statSyncNoException(pathToOpen).isFile?())
existingWindow ?= window ? @lastFocusedWindow
if existingWindow?
openedWindow = existingWindow
openedWindow.openLocations(locationsToOpen)