mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
@@ -142,3 +142,9 @@ describe "Starting Atom", ->
|
||||
client
|
||||
.waitForExist("atom-workspace")
|
||||
.waitForPaneItemCount(1, 5000)
|
||||
|
||||
# Opening with no file paths always creates a new window, even if
|
||||
# existing windows have no project paths.
|
||||
.waitForNewWindow(->
|
||||
@startAnotherAtom([], ATOM_HOME: AtomHome)
|
||||
, 5000)
|
||||
|
||||
@@ -361,12 +361,11 @@ class AtomApplication
|
||||
|
||||
# Default to using the specified window or the last focused window
|
||||
currentWindow = window ? @lastFocusedWindow
|
||||
|
||||
if pathsToOpen.every((pathToOpen) -> fs.statSyncNoException(pathToOpen).isFile?())
|
||||
existingWindow ?= currentWindow
|
||||
|
||||
unless currentWindow?.projectPaths?.length > 0
|
||||
existingWindow ?= currentWindow
|
||||
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()
|
||||
)
|
||||
|
||||
if existingWindow?
|
||||
openedWindow = existingWindow
|
||||
|
||||
Reference in New Issue
Block a user