mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Loading root view with no url opens an empty buffer
This commit is contained in:
@@ -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", ->
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user