Loading root view with no url opens an empty buffer

This commit is contained in:
Corey Johnson
2012-03-30 09:42:02 -07:00
parent 629517af9e
commit dc7edc22cf
2 changed files with 3 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ describe "RootView", ->
describe "when not called with a url", ->
it "opens an empty buffer", ->
rootView = new RootView
expect(rootView.editors.length).toBe 1
expect(rootView.activeEditor().buffer.url).toBeUndefined()
describe "focus", ->

View File

@@ -48,6 +48,8 @@ class RootView extends View
if path
@project = new Project(fs.directory(path))
@open(path) if fs.isFile(path)
else
@activeEditor().setBuffer(new Buffer())
open: (path) ->
@activeEditor().setBuffer(@project.open(path))