mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
When opening a file, don't also create an edit session or an empty buffer
Also: RootView.proto.activeEditor no longer constructs an editor. To open an empty buffer, call RootView.proto.open with no path argument. It will build a new editor if needed.
This commit is contained in:
@@ -24,6 +24,7 @@ describe "RootView", ->
|
||||
expect(rootView.editors().length).toBe 1
|
||||
expect(rootView.editors()[0]).toHaveClass 'active'
|
||||
expect(rootView.activeEditor().buffer.getPath()).toBe path
|
||||
expect(rootView.activeEditor().editSessions.length).toBe 1
|
||||
expect(document.title).toBe path
|
||||
|
||||
describe "when pathToOpen references a directory", ->
|
||||
@@ -116,7 +117,7 @@ describe "RootView", ->
|
||||
rootView.attachToDom()
|
||||
expect(rootView).toMatchSelector(':focus')
|
||||
|
||||
rootView.activeEditor() # lazily create an editor
|
||||
rootView.open() # create an editor
|
||||
expect(rootView).not.toMatchSelector(':focus')
|
||||
expect(rootView.activeEditor().isFocused).toBeTruthy()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user