mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Merge pull request #875 from atom/bo-multiple-new-files
Allow users to create more than one empty buffer
This commit is contained in:
@@ -212,6 +212,12 @@ describe "RootView", ->
|
||||
expect(editSession.getPath()).toBeUndefined()
|
||||
expect(rootView.getActivePane().focus).toHaveBeenCalled()
|
||||
|
||||
it "can create multiple empty edit sessions as an item on a new pane", ->
|
||||
editSession = rootView.open()
|
||||
editSession2 = rootView.open()
|
||||
expect(rootView.getActivePane().getItems().length).toBe 2
|
||||
expect(editSession).not.toBe editSession2
|
||||
|
||||
describe "when called with a path", ->
|
||||
it "creates an edit session for the given path as an item on a new pane, and focuses the pane", ->
|
||||
editSession = rootView.open('b')
|
||||
|
||||
@@ -173,7 +173,8 @@ class RootView extends View
|
||||
initialLine = options.initialLine
|
||||
path = project.relativize(path)
|
||||
if activePane = @getActivePane()
|
||||
editSession = activePane.itemForUri(path) ? project.open(path, {initialLine})
|
||||
editSession = activePane.itemForUri(path) if path
|
||||
editSession ?= project.open(path, {initialLine})
|
||||
activePane.showItem(editSession)
|
||||
else
|
||||
editSession = project.open(path, {initialLine})
|
||||
|
||||
Reference in New Issue
Block a user