No more typeless decorations

Now you can specify a list of types with your decoration.
This commit is contained in:
Ben Ogle
2014-06-13 17:39:32 -07:00
parent 1ebdd801f5
commit 031ec9798a
2 changed files with 5 additions and 3 deletions

View File

@@ -12,5 +12,7 @@ class Decoration
@marker?.isValid()
isType: (decorationType) ->
return true unless @type
decorationType is @type
if _.isArray(@type)
decorationType in @type
else
decorationType is @type

View File

@@ -1233,7 +1233,7 @@ class Editor extends Model
addCursor: (marker) ->
cursor = new Cursor(editor: this, marker: marker)
@cursors.push(cursor)
@addDecorationForMarker(marker, {class: 'cursor-line'})
@addDecorationForMarker(marker, type: ['gutter', 'line'], class: 'cursor-line')
@emit 'cursor-added', cursor
cursor