This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -2034,19 +2034,15 @@ class TextBuffer
20342034 snapshot
20352035
20362036 restoreFromMarkerSnapshot : (snapshot , selectionsMarkerLayer ) ->
2037- console .log ' restore' , selectionsMarkerLayer
2038-
20392037 if selectionsMarkerLayer?
2040- # When snapshot includes multiple layerSnapshot of `role`, disable snapshot restore target redirection
2041- # to avoid multiple layerSnapshots being restored to single markerLayer.
2038+ # Do selective selections marker restoration only when snapshot includes single selections snapshot.
20422039 selectionsSnapshotIds = Object .keys (snapshot).filter (id) => @selectionsMarkerLayerIds .has (id)
20432040 if selectionsSnapshotIds .length is 1
20442041 selectionsSnapshotId = selectionsSnapshotIds[0 ]
2045- alwaysCreate = selectionsSnapshotId isnt selectionsMarkerLayer .id
20462042
20472043 for markerLayerId, layerSnapshot of snapshot
2048- if selectionsMarkerLayer ? and markerLayerId is selectionsSnapshotId
2049- @markerLayers [selectionsMarkerLayer .id ].restoreFromSnapshot (layerSnapshot, alwaysCreate )
2044+ if markerLayerId is selectionsSnapshotId
2045+ @markerLayers [selectionsMarkerLayer .id ].restoreFromSnapshot (layerSnapshot, markerLayerId isnt selectionsMarkerLayer . id )
20502046 else
20512047 @markerLayers [markerLayerId]? .restoreFromSnapshot (layerSnapshot)
20522048
You can’t perform that action at this time.
0 commit comments