Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit ce71a43

Browse files
author
Nathan Sobo
committed
Don’t process updates on destroyed markers
In particular, we want to avoid re-inserting destroyed markers into the marker index. But really we shouldn’t do anything when they are updated. Fixes #6899
1 parent 374e656 commit ce71a43

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎spec/marker-spec.coffee‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,13 @@ describe "Marker", ->
942942
expect(marker.getStartPosition()).toEqual [0, 3]
943943
expect(marker.getEndPosition()).toEqual [0, 6]
944944

945+
it "does not reinsert a marker into ", ->
946+
marker = buffer.markRange([[0, 3], [0, 6]])
947+
marker.destroy()
948+
expect(buffer.findMarkers(intersectsRow: 0)).toEqual []
949+
marker.setRange([[0, 0], [0, 9]])
950+
expect(buffer.findMarkers(intersectsRow: 0)).toEqual []
951+
945952
describe "TextBuffer::findMarkers(properties)", ->
946953
[marker1, marker2, marker3, marker4] = []
947954

‎src/marker.coffee‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,8 @@ class Marker
330330
isEqual(@properties[key], value)
331331

332332
update: (oldRange, {range, reversed, tailed, valid, properties}, textChanged=false) ->
333+
return if @isDestroyed()
334+
333335
updated = propertiesChanged = false
334336

335337
if range? and not range.isEqual(oldRange)

0 commit comments

Comments
 (0)