mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Add getters for decoration types in addition to ‘overlay’
This commit is contained in:
@@ -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')
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user