mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
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:
parent
7d22ed788c
commit
3a25fe4975
@ -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", ->
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user