Saving a buffer sets its modified flag to false

This commit is contained in:
Corey Johnson
2012-06-12 11:29:38 -07:00
parent 8ab167fd00
commit 1fb8852fc3
2 changed files with 13 additions and 1 deletions

View File

@@ -161,9 +161,10 @@ class Buffer
@undoManager.redo()
save: ->
if not @getPath() then throw new Error("Tried to save buffer with no file path")
if not @getPath() then throw new Error("Can't save buffer with no file path")
@trigger 'before-save'
fs.write @getPath(), @getText()
@modified = false
@trigger 'after-save'
saveAs: (path) ->