mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Use atom.deserializers directly
This commit is contained in:
@@ -27,7 +27,7 @@ class DisplayBuffer
|
||||
if optionsOrState instanceof telepath.Document
|
||||
@state = optionsOrState
|
||||
@id = @state.get('id')
|
||||
@tokenizedBuffer = deserialize(@state.get('tokenizedBuffer'))
|
||||
@tokenizedBuffer = atom.deserializers.deserialize(@state.get('tokenizedBuffer'))
|
||||
@buffer = @tokenizedBuffer.buffer
|
||||
else
|
||||
{@buffer, softWrap, editorWidthInChars} = optionsOrState
|
||||
|
||||
@@ -67,7 +67,7 @@ class Editor
|
||||
if optionsOrState instanceof telepath.Document
|
||||
@state = optionsOrState
|
||||
@id = @state.get('id')
|
||||
displayBuffer = deserialize(@state.get('displayBuffer'))
|
||||
displayBuffer = atom.deserializers.deserialize(@state.get('displayBuffer'))
|
||||
@setBuffer(displayBuffer.buffer)
|
||||
@setDisplayBuffer(displayBuffer)
|
||||
for marker in @findMarkers(@getSelectionMarkerAttributes())
|
||||
|
||||
@@ -12,7 +12,8 @@ class PaneAxis extends View
|
||||
initialize: (args...) ->
|
||||
if args[0] instanceof telepath.Document
|
||||
@state = args[0]
|
||||
@state.get('children').each (child, index) => @addChild(deserialize(child), index, updateState: false)
|
||||
@state.get('children').each (child, index) =>
|
||||
@addChild(atom.deserializers.deserialize(child), index, updateState: false)
|
||||
else
|
||||
@state = atom.site.createDocument(deserializer: @className(), children: [])
|
||||
@addChild(child) for child in args
|
||||
@@ -22,7 +23,7 @@ class PaneAxis extends View
|
||||
for childState in removedValues
|
||||
@removeChild(@children(":eq(#{index})").view(), updateState: false)
|
||||
for childState, i in insertedValues
|
||||
@addChild(deserialize(childState), index + i, updateState: false)
|
||||
@addChild(atom.deserializers.deserialize(childState), index + i, updateState: false)
|
||||
|
||||
addChild: (child, index=@children().length, options={}) ->
|
||||
@insertAt(index, child)
|
||||
|
||||
Reference in New Issue
Block a user