From 031ec9798a643deb3dbf1ad63838e3f542e321a5 Mon Sep 17 00:00:00 2001 From: Ben Ogle Date: Fri, 13 Jun 2014 17:39:32 -0700 Subject: [PATCH] No more typeless decorations Now you can specify a list of types with your decoration. --- src/decoration.coffee | 6 ++++-- src/editor.coffee | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/decoration.coffee b/src/decoration.coffee index af3204393..e1400f354 100644 --- a/src/decoration.coffee +++ b/src/decoration.coffee @@ -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 diff --git a/src/editor.coffee b/src/editor.coffee index c9b0aa657..35ac0e066 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -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