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:
Nathan Sobo
2012-04-13 17:47:41 -06:00
parent c899b5e827
commit 07acf0817e
2 changed files with 15 additions and 15 deletions

View File

@@ -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()