mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 04:48:44 +03:00
Factor out common buffer loading code
This commit is contained in:
parent
bb281ce5af
commit
7002b4e5f6
@ -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 ###
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user