diff --git a/src/text-editor-component.js b/src/text-editor-component.js index da62af98c..fe3eb15c3 100644 --- a/src/text-editor-component.js +++ b/src/text-editor-component.js @@ -3453,12 +3453,7 @@ class LinesTileComponent { textNodesByScreenLineId }) this.element.insertBefore(newScreenLineComponent.element, oldScreenLineComponent.element) - // Instead of calling destroy on the component here we can simply - // remove its associated element, thus skipping the - // lineNodesByScreenLineId bookkeeping. This is possible because - // lineNodesByScreenLineId has already been updated when creating the - // new screen line component. - oldScreenLineComponent.element.remove() + oldScreenLineComponent.destroy() this.lineComponents[lineComponentIndex] = newScreenLineComponent oldScreenLineIndex++