mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Use Buffer.getPath and Buffer.setPath(path)
This commit is contained in:
@@ -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", ->
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user