Remove id from decoration properties

It doesn’t make sense to include this when we’ll reuse the same
properties for multiple decoration instances when decorating marker
layers.
This commit is contained in:
Nathan Sobo 2015-10-26 19:08:02 -06:00
parent 7d22ed788c
commit 3a25fe4975
3 changed files with 2 additions and 4 deletions

View File

@ -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", ->

View File

@ -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,
}

View File

@ -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()