mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
@@ -121,3 +121,13 @@ describe "Starting Atom", ->
|
||||
projectPaths.push(value[0])
|
||||
.then ->
|
||||
expect(projectPaths.sort()).toEqual([tempDirPath, otherTempDirPath].sort())
|
||||
|
||||
it "opens the path in the current window if it doesn't have a project path yet", ->
|
||||
runAtom [], {ATOM_HOME: AtomHome}, (client) ->
|
||||
client
|
||||
.waitForExist("atom-workspace")
|
||||
.startAnotherAtom([tempDirPath], ATOM_HOME: AtomHome)
|
||||
.waitUntil((->
|
||||
@title()
|
||||
.then(({value}) -> value.indexOf(path.basename(tempDirPath)) >= 0)), 5000)
|
||||
.waitForWindowCount(1, 5000)
|
||||
|
||||
@@ -360,8 +360,13 @@ class AtomApplication
|
||||
existingWindow = @windowForPaths(pathsToOpen, devMode)
|
||||
|
||||
# Default to using the specified window or the last focused window
|
||||
currentWindow = window ? @lastFocusedWindow
|
||||
|
||||
if pathsToOpen.every((pathToOpen) -> fs.statSyncNoException(pathToOpen).isFile?())
|
||||
existingWindow ?= window ? @lastFocusedWindow
|
||||
existingWindow ?= currentWindow
|
||||
|
||||
unless currentWindow?.projectPaths?.length > 0
|
||||
existingWindow ?= currentWindow
|
||||
|
||||
if existingWindow?
|
||||
openedWindow = existingWindow
|
||||
|
||||
Reference in New Issue
Block a user