diff --git a/spec/app/buffer-spec.coffee b/spec/app/buffer-spec.coffee index c19b336fa..ccfbd3dd4 100644 --- a/spec/app/buffer-spec.coffee +++ b/spec/app/buffer-spec.coffee @@ -337,6 +337,7 @@ describe 'Buffer', -> filePath = '/tmp/temp.txt' fs.write(filePath, "") saveBuffer = new Buffer filePath + saveBuffer.setText("blah") it "saves the contents of the buffer to the path", -> saveBuffer.setText 'Buffer contents!' @@ -370,6 +371,7 @@ describe 'Buffer', -> describe "when the buffer has no path", -> it "throws an exception", -> saveBuffer = new Buffer + saveBuffer.setText "hi" expect(-> saveBuffer.save()).toThrow() describe "reload()", -> diff --git a/src/app/buffer.coffee b/src/app/buffer.coffee index 528caa2e6..5f8bc4182 100644 --- a/src/app/buffer.coffee +++ b/src/app/buffer.coffee @@ -238,7 +238,7 @@ class Buffer @undoManager.redo(editSession) save: -> - @saveAs(@getPath()) + @saveAs(@getPath()) if @isModified() saveAs: (path) -> unless path then throw new Error("Can't save buffer with no file path")