mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Add Project.getState() and make Project.serialize clone state
This commit is contained in:
@@ -11,7 +11,7 @@ describe "Project replication", ->
|
||||
project1.bufferForPath('a')
|
||||
expect(project1.getBuffers().length).toBe 1
|
||||
|
||||
doc1 = project1.serialize()
|
||||
doc1 = project1.getState()
|
||||
doc2 = doc1.clone(createSite(2))
|
||||
doc1.connect(doc2)
|
||||
|
||||
|
||||
@@ -71,8 +71,8 @@ class Project
|
||||
for insertedBuffer, i in inserted
|
||||
@addBufferAtIndex(deserialize(insertedBuffer), index + i, updateState: false)
|
||||
|
||||
serialize: ->
|
||||
@state
|
||||
serialize: -> @state.clone()
|
||||
getState: -> @state
|
||||
|
||||
# Retrieves the project path.
|
||||
#
|
||||
|
||||
@@ -123,7 +123,7 @@ window.deserializeEditorWindow = ->
|
||||
window.project = deserialize(windowState.get('project'))
|
||||
unless window.project?
|
||||
window.project = new Project(atom.getLoadSettings().initialPath)
|
||||
windowState.set('project', window.project.serialize())
|
||||
windowState.set('project', window.project.getState())
|
||||
|
||||
window.rootView = deserialize(windowState.get('rootView'))
|
||||
unless window.rootView?
|
||||
|
||||
Reference in New Issue
Block a user