Allow for typeless decorations that apply to everything

If you are querying for `type: ‘gutter’` it will return the typeless 
decorations as well.
This commit is contained in:
Ben Ogle
2014-06-06 15:44:59 -07:00
parent a8df77243c
commit 346b6007ca

View File

@@ -722,7 +722,7 @@ class DisplayBuffer extends Model
decorationsForBufferRow: (bufferRow, decorationType) ->
decorations = @decorations[bufferRow] ? []
decorations = (dec for dec in decorations when dec.type is decorationType) if decorationType?
decorations = (dec for dec in decorations when not dec.type? or dec.type is decorationType) if decorationType?
decorations
decorationsForBufferRowRange: (startBufferRow, endBufferRow, decorationType) ->