diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index e9891b10f..5d8716284 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -889,6 +889,9 @@ class DisplayBuffer extends Model allDecorations = allDecorations.concat(decorations) if decorations? allDecorations + getOverlayDecorations: -> + @getDecorations().filter (decoration) -> decoration.isType('overlay') + decorationsForScreenRowRange: (startScreenRow, endScreenRow) -> decorationsByMarkerId = {} for marker in @findMarkers(intersectsScreenRowRange: [startScreenRow, endScreenRow]) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index af99c1a50..30147501c 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -1293,6 +1293,18 @@ class TextEditor extends Model decorationsForScreenRowRange: (startScreenRow, endScreenRow) -> @displayBuffer.decorationsForScreenRowRange(startScreenRow, endScreenRow) + # Extended: Get all decorations. + # + # Returns an {Array} of {Decoration}s. + getDecorations: -> + @displayBuffer.getDecorations() + + # Extended: Get all decorations of type 'overlay'. + # + # Returns an {Array} of {Decoration}s. + getOverlayDecorations: -> + @displayBuffer.getOverlayDecorations() + decorationForId: (id) -> @displayBuffer.decorationForId(id)