Add Project.getState() and make Project.serialize clone state

This commit is contained in:
Nathan Sobo
2013-07-20 21:24:32 -06:00
parent 97c4b9a83a
commit 5246d4cd72
3 changed files with 4 additions and 4 deletions

View File

@@ -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.
#

View File

@@ -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?