Change @loadFromDisk to @useSerializedText

This commit is contained in:
probablycorey 2013-10-25 14:21:39 -07:00
parent 5cee47c207
commit feed72b68e

View File

@ -48,7 +48,7 @@ class TextBuffer
@id = @state.get('id')
filePath = @state.get('relativePath')
@text = @state.get('text')
@loadFromDisk = @state.get('isModified') == false
@useSerializedText = @state.get('isModified') != false
else
{@project, filePath} = optionsOrState
@text = site.createDocument(initialText ? '', shareStrings: true)
@ -68,12 +68,12 @@ class TextBuffer
loadSync: ->
@updateCachedDiskContentsSync()
@reload() if @loadFromDisk or @state.get('diskContentsDigest') != @file?.getDigest()
@reload() unless @useSerializedText and @state.get('diskContentsDigest') == @file?.getDigest()
@text.clearUndoStack()
load: ->
@updateCachedDiskContents().then =>
@reload() if @loadFromDisk or @state.get('diskContentsDigest') != @file?.getDigest()
@reload() unless @useSerializedText and @state.get('diskContentsDigest') == @file?.getDigest()
@text.clearUndoStack()
this