mirror of
https://github.com/atom/atom.git
synced 2026-02-08 13:45:09 -05:00
Don’t return Decoration objects from model to view
Preparation for LayerDecorations, in which individual decoration objects won’t exist for every marker.
This commit is contained in:
@@ -774,6 +774,18 @@ class DisplayBuffer extends Model
|
||||
decorationsByMarkerId[marker.id] = decorations
|
||||
decorationsByMarkerId
|
||||
|
||||
decorationStateForScreenRowRange: (startScreenRow, endScreenRow) ->
|
||||
decorationState = {}
|
||||
for marker in @findMarkers(intersectsScreenRowRange: [startScreenRow, endScreenRow]) when marker.isValid()
|
||||
if decorations = @decorationsByMarkerId[marker.id]
|
||||
for decoration in decorations
|
||||
decorationState[decoration.id] = {
|
||||
properties: decoration.getProperties()
|
||||
screenRange: marker.getScreenRange()
|
||||
rangeIsReversed: marker.isReversed()
|
||||
}
|
||||
decorationState
|
||||
|
||||
decorateMarker: (marker, decorationParams) ->
|
||||
marker = @getMarker(marker.id)
|
||||
decoration = new Decoration(marker, this, decorationParams)
|
||||
|
||||
Reference in New Issue
Block a user