From 90242a787fb4f402849c8ebd94978e7ca413d706 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 30 Mar 2012 11:20:17 -0700 Subject: [PATCH] Use Buffer.getPath and Buffer.setPath(path) --- spec/atom/root-view-spec.coffee | 2 +- src/atom/editor.coffee | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/atom/root-view-spec.coffee b/spec/atom/root-view-spec.coffee index e13e10a58..adcb6632c 100644 --- a/spec/atom/root-view-spec.coffee +++ b/spec/atom/root-view-spec.coffee @@ -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", -> diff --git a/src/atom/editor.coffee b/src/atom/editor.coffee index 94971317d..5f5b0574e 100644 --- a/src/atom/editor.coffee +++ b/src/atom/editor.coffee @@ -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)