diff --git a/src/display-buffer.coffee b/src/display-buffer.coffee index 5d8716284..2fec5c60a 100644 --- a/src/display-buffer.coffee +++ b/src/display-buffer.coffee @@ -889,6 +889,15 @@ class DisplayBuffer extends Model allDecorations = allDecorations.concat(decorations) if decorations? allDecorations + getLineDecorations: -> + @getDecorations().filter (decoration) -> decoration.isType('line') + + getGutterDecorations: -> + @getDecorations().filter (decoration) -> decoration.isType('gutter') + + getHighlightDecorations: -> + @getDecorations().filter (decoration) -> decoration.isType('highlight') + getOverlayDecorations: -> @getDecorations().filter (decoration) -> decoration.isType('overlay') diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 5f3ff226b..c210f3eef 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -1314,6 +1314,24 @@ class TextEditor extends Model getDecorations: -> @displayBuffer.getDecorations() + # Extended: Get all decorations of type 'line'. + # + # Returns an {Array} of {Decoration}s. + getLineDecorations: -> + @displayBuffer.getLineDecorations() + + # Extended: Get all decorations of type 'gutter'. + # + # Returns an {Array} of {Decoration}s. + getGutterDecorations: -> + @displayBuffer.getGutterDecorations() + + # Extended: Get all decorations of type 'highlight'. + # + # Returns an {Array} of {Decoration}s. + getHighlightDecorations: -> + @displayBuffer.getHighlightDecorations() + # Extended: Get all decorations of type 'overlay'. # # Returns an {Array} of {Decoration}s.