revert decoration dispose changes (#4215)

This commit is contained in:
Megan Rogge
2022-10-18 21:32:22 +00:00
committed by GitHub
parent 376f0d9972
commit 0b84d17b18
3 changed files with 17 additions and 15 deletions
@@ -98,7 +98,6 @@ export class BufferDecorationRenderer extends Disposable {
} else {
let element = this._decorationElements.get(decoration);
if (!element) {
decoration.onDispose(() => this._removeDecoration(decoration));
element = this._createElement(decoration);
decoration.element = element;
this._decorationElements.set(decoration, element);
@@ -125,5 +124,6 @@ export class BufferDecorationRenderer extends Disposable {
private _removeDecoration(decoration: IInternalDecoration): void {
this._decorationElements.get(decoration)?.remove();
this._decorationElements.delete(decoration);
decoration.dispose();
}
}