mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Use Atom::replicate in git spec to simulate project serialization
This commit is contained in:
@@ -317,6 +317,10 @@ class Atom
|
||||
else
|
||||
@windowState
|
||||
|
||||
# Private: Returns a replicated copy of the current state.
|
||||
replicate: ->
|
||||
@windowState.replicate()
|
||||
|
||||
crashMainProcess: ->
|
||||
remote.process.crash()
|
||||
|
||||
|
||||
@@ -71,8 +71,7 @@ class Git
|
||||
@refreshStatus()
|
||||
|
||||
if project?
|
||||
@subscribeToBuffer(buffer) for buffer in project.getBuffers()
|
||||
@subscribe project, 'buffer-created', (buffer) => @subscribeToBuffer(buffer)
|
||||
@subscribe project.buffers.onEach (buffer) => @subscribeToBuffer(buffer)
|
||||
|
||||
# Private: Subscribes to buffer events.
|
||||
subscribeToBuffer: (buffer) ->
|
||||
|
||||
@@ -34,6 +34,11 @@ class TextBuffer extends Model
|
||||
file: null
|
||||
refcount: 0
|
||||
|
||||
constructor: ->
|
||||
super
|
||||
|
||||
@loadWhenAttached = @getState()?
|
||||
|
||||
# Private: Called by telepath
|
||||
attached: ->
|
||||
@loaded = false
|
||||
@@ -45,6 +50,8 @@ class TextBuffer extends Model
|
||||
|
||||
@setPath(@filePath)
|
||||
|
||||
@load() if @loadWhenAttached
|
||||
|
||||
# Private: Called by telepath
|
||||
beforePersistence: ->
|
||||
@modifiedWhenLastPersisted = @isModified()
|
||||
|
||||
Reference in New Issue
Block a user