Use Buffer.getPath and Buffer.setPath(path)

This commit is contained in:
Corey Johnson
2012-03-30 11:20:17 -07:00
parent 551f09dce6
commit 90242a787f
2 changed files with 6 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ describe "RootView", ->
describe "when called with a url that references a file", ->
it "creates a project for the file's parent directory and opens it in the editor", ->
expect(rootView.project.url).toBe fs.directory(url)
expect(rootView.activeEditor().buffer.path).toBe url
expect(rootView.activeEditor().buffer.getPath()).toBe url
describe "when called with a url that references a directory", ->
it "creates a project for the directory and opens an empty buffer", ->

View File

@@ -218,7 +218,7 @@ class Editor extends View
@buffer = buffer
document.title = @buffer.path
document.title = @buffer.getPath()
@renderer = new Renderer(@buffer)
@renderLines()
@gutter.renderLineNumbers()
@@ -323,13 +323,13 @@ class Editor extends View
$(window).off 'resize', @_setMaxLineLength
save: ->
if not @buffer.path
if not @buffer.getPath()
path = $native.saveDialog()
return if not path
document.title = path
@buffer.path = path
@buffer.save()
@buffer.saveAs(path)
else
@buffer.save()
clipScreenPosition: (screenPosition, options={}) ->
@renderer.clipScreenPosition(screenPosition, options)