mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Factor out common buffer loading code
This commit is contained in:
@@ -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 ###
|
||||
|
||||
|
||||
Reference in New Issue
Block a user