Use file contents instead of md5 to determine disk change

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-11-28 17:16:44 -08:00
parent 2f6566d1c5
commit e98b4f9a9b
3 changed files with 20 additions and 23 deletions

View File

@@ -76,10 +76,7 @@ class Buffer
@setText(@cachedDiskContents)
updateCachedDiskContents: ->
if fs.exists(@getPath())
@cachedDiskContents = fs.read(@getPath())
else
@cachedDiskContents = null
@cachedDiskContents = @file.read()
getBaseName: ->
@file?.getBaseName()
@@ -239,14 +236,9 @@ class Buffer
unless path then throw new Error("Can't save buffer with no file path")
@trigger 'before-save'
@file?.updateMd5()
@setPath(path)
text = @getText()
@cachedDiskContents = text
@file.write(text)
@cachedDiskContents = @getText()
@file.write(@getText())
@subscribeToFile()
@trigger 'after-save'