Always open all CLI paths in the same window

No more 'atom --multi-folder'
This commit is contained in:
Max Brunsfeld
2015-03-05 15:05:36 -08:00
parent c286b0d4c9
commit a6e8f8a08a
3 changed files with 3 additions and 35 deletions

View File

@@ -87,7 +87,7 @@ describe "Starting Atom", ->
nestedDir = path.join(otherTempDirPath, "nested-dir")
fs.mkdirSync(nestedDir)
runAtom [tempDirPath, otherTempDirPath, "--multi-folder"], {ATOM_HOME: AtomHome}, (client) ->
runAtom [tempDirPath, otherTempDirPath], {ATOM_HOME: AtomHome}, (client) ->
client
.waitForExist("atom-workspace", 5000)
.treeViewRootDirectories()
@@ -100,31 +100,6 @@ describe "Starting Atom", ->
.treeViewRootDirectories()
.then ({value}) -> expect(value).toEqual([tempDirPath, otherTempDirPath])
it "opens each path in its own window unless the --multi-folder flag is passed", ->
runAtom [tempDirPath, otherTempDirPath], {ATOM_HOME: AtomHome}, (client) ->
treeViewDirs = []
client
.waitForExist("atom-workspace", 5000)
.waitForWindowCount(2, 10000)
.then ({value: windowHandles}) ->
@window(windowHandles[0])
.waitForExist("atom-workspace")
.treeViewRootDirectories()
.then ({value}) ->
expect(value).toHaveLength(1)
treeViewDirs.push(value[0])
.window(windowHandles[1])
.waitForExist("atom-workspace")
.treeViewRootDirectories()
.then ({value}) ->
expect(value).toHaveLength(1)
treeViewDirs.push(value[0])
.then ->
expect(treeViewDirs.sort()).toEqual([tempDirPath, otherTempDirPath].sort())
describe "when there is an existing window with no project path", ->
describe "opening a directory", ->
it "opens the directory in the existing window", ->

View File

@@ -60,7 +60,7 @@ class AtomApplication
exit: (status) -> app.exit(status)
constructor: (options) ->
{@resourcePath, @version, @devMode, @safeMode, @socketPath, @enableMultiFolderProject} = options
{@resourcePath, @version, @devMode, @safeMode, @socketPath} = options
# Normalize to make sure drive letter case is consistent on Windows
@resourcePath = path.normalize(@resourcePath) if @resourcePath
@@ -348,11 +348,6 @@ class AtomApplication
# :windowDimensions - Object with height and width keys.
# :window - {AtomWindow} to open file paths in.
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, window}={}) ->
if pathsToOpen?.length > 1 and not @enableMultiFolderProject
for pathToOpen in pathsToOpen
@openPath({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, window})
return
pathsToOpen = (fs.normalize(pathToOpen) for pathToOpen in pathsToOpen)
locationsToOpen = (@locationForPathToOpen(pathToOpen) for pathToOpen in pathsToOpen)

View File

@@ -118,7 +118,6 @@ parseCommandLine = ->
options.alias('v', 'version').boolean('v').describe('v', 'Print the version.')
options.alias('w', 'wait').boolean('w').describe('w', 'Wait for window to be closed before returning.')
options.string('socket-path')
options.boolean('multi-folder')
args = options.argv
if args.help
@@ -140,7 +139,6 @@ parseCommandLine = ->
pidToKillWhenClosed = args['pid'] if args['wait']
logFile = args['log-file']
socketPath = args['socket-path']
enableMultiFolderProject = args['multi-folder']
if args['resource-path']
devMode = true
@@ -166,6 +164,6 @@ parseCommandLine = ->
process.env.PATH = args['path-environment'] if args['path-environment']
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed,
devMode, safeMode, newWindow, specDirectory, logFile, socketPath, enableMultiFolderProject}
devMode, safeMode, newWindow, specDirectory, logFile, socketPath}
start()