mirror of
https://github.com/atom/atom.git
synced 2026-02-19 02:44:29 -05:00
Relativize buffer paths for replication
TextBuffers now maintain a reference to their containing project to make it easier to test replication of buffers between environments without worrying about the value of the `project` global. We're also starting the process of moving the `git` global into Project as the `Project.repository` property.
This commit is contained in:
@@ -132,14 +132,10 @@ window.deserializeEditorWindow = ->
|
||||
|
||||
$(rootViewParentSelector).append(rootView)
|
||||
|
||||
window.git = Git.open(project.getPath())
|
||||
project.on 'path-changed', ->
|
||||
projectPath = project.getPath()
|
||||
atom.getLoadSettings().initialPath = projectPath
|
||||
|
||||
window.git?.destroy()
|
||||
window.git = Git.open(projectPath)
|
||||
|
||||
window.deserializeConfigWindow = ->
|
||||
ConfigView = require 'config-view'
|
||||
window.configView = deserialize(atom.getWindowState('configView')) ? new ConfigView()
|
||||
@@ -232,13 +228,13 @@ window.registerDeferredDeserializer = (name, fn) ->
|
||||
window.unregisterDeserializer = (klass) ->
|
||||
delete deserializers[klass.name]
|
||||
|
||||
window.deserialize = (state) ->
|
||||
window.deserialize = (state, params) ->
|
||||
if deserializer = getDeserializer(state)
|
||||
stateVersion = state.get?('version') ? state.version
|
||||
return if deserializer.version? and deserializer.version isnt stateVersion
|
||||
if (state instanceof telepath.Document) and not deserializer.acceptsDocuments
|
||||
state = state.toObject()
|
||||
deserializer.deserialize(state)
|
||||
deserializer.deserialize(state, params)
|
||||
|
||||
window.getDeserializer = (state) ->
|
||||
return unless state?
|
||||
|
||||
Reference in New Issue
Block a user