Factor out common buffer loading code

This commit is contained in:
probablycorey 2013-10-25 15:26:56 -07:00
parent bb281ce5af
commit 7002b4e5f6

View File

@ -68,22 +68,19 @@ class TextBuffer
loadSync: ->
@updateCachedDiskContentsSync()
@finishLoading()
load: ->
@updateCachedDiskContents().then => @finishLoading()
finishLoading: ->
@loaded = true
if @useSerializedText and @state.get('diskContentsDigest') == @file?.getDigest()
@emitModifiedStatusChanged(true)
else
@reload()
@text.clearUndoStack()
load: ->
@updateCachedDiskContents().then =>
@loaded = true
if @useSerializedText and @state.get('diskContentsDigest') == @file?.getDigest()
@emitModifiedStatusChanged(true)
else
@reload()
@text.clearUndoStack()
this
this
### Internal ###