From 3a25fe49752f6d06f6c48ddc267ddf2c1822d1ca Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 26 Oct 2015 19:08:02 -0600 Subject: [PATCH] Remove id from decoration properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn’t make sense to include this when we’ll reuse the same properties for multiple decoration instances when decorating marker layers. --- spec/display-buffer-spec.coffee | 2 +- spec/text-editor-spec.coffee | 2 +- src/decoration.coffee | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/display-buffer-spec.coffee b/spec/display-buffer-spec.coffee index ded3ed455..accda876a 100644 --- a/spec/display-buffer-spec.coffee +++ b/spec/display-buffer-spec.coffee @@ -1244,7 +1244,7 @@ describe "DisplayBuffer", -> {oldProperties, newProperties} = updatedSpy.mostRecentCall.args[0] expect(oldProperties).toEqual decorationProperties - expect(newProperties).toEqual type: 'line-number', gutterName: 'line-number', class: 'two', id: decoration.id + expect(newProperties).toEqual {type: 'line-number', gutterName: 'line-number', class: 'two'} describe "::getDecorations(properties)", -> it "returns decorations matching the given optional properties", -> diff --git a/spec/text-editor-spec.coffee b/spec/text-editor-spec.coffee index e7dd75618..d999d76c0 100644 --- a/spec/text-editor-spec.coffee +++ b/spec/text-editor-spec.coffee @@ -5605,7 +5605,7 @@ describe "TextEditor", -> marker = editor.markBufferRange([[2, 4], [6, 8]]) decoration = editor.decorateMarker(marker, type: 'highlight', class: 'foo') expect(editor.decorationStateForScreenRowRange(0, 5)[decoration.id]).toEqual { - properties: {type: 'highlight', class: 'foo', id: decoration.id} + properties: {type: 'highlight', class: 'foo'} screenRange: marker.getScreenRange(), rangeIsReversed: false, } diff --git a/src/decoration.coffee b/src/decoration.coffee index e5d9f5144..937909ec7 100644 --- a/src/decoration.coffee +++ b/src/decoration.coffee @@ -67,7 +67,6 @@ class Decoration @emitter = new Emitter @id = nextId() @setProperties properties - @properties.id = @id @destroyed = false @markerDestroyDisposable = @marker.onDidDestroy => @destroy() @@ -150,7 +149,6 @@ class Decoration return if @destroyed oldProperties = @properties @properties = translateDecorationParamsOldToNew(newProperties) - @properties.id = @id if newProperties.type? @displayBuffer.decorationDidChangeType(this) @displayBuffer.scheduleUpdateDecorationsEvent()