remove test
This commit is contained in:
@@ -106,6 +106,9 @@ export class BufferDecorationRenderer extends Disposable {
|
||||
|
||||
private _removeDecoration(decoration: IInternalDecoration): void {
|
||||
const element = this._decorationElements.get(decoration);
|
||||
if (element && this._container && this._container.contains(element)) {
|
||||
this._container.removeChild(element);
|
||||
}
|
||||
element?.remove();
|
||||
this._decorationElements.delete(decoration);
|
||||
}
|
||||
|
||||
@@ -75,12 +75,12 @@ export class OverviewRulerRenderer extends Disposable {
|
||||
} else {
|
||||
this._canvas.style.left = decoration.options.x ? `${decoration.options.x * this._renderService.dimensions.actualCellWidth}px` : '';
|
||||
}
|
||||
if (!decoration.options.overviewRulerItemColor) {
|
||||
if (!decoration.options.overviewRulerOptions?.color) {
|
||||
this._decorationElements.delete(decoration);
|
||||
return;
|
||||
}
|
||||
this._ctx.lineWidth = 1;
|
||||
this._ctx.strokeStyle = decoration.options.overviewRulerItemColor;
|
||||
this._ctx.strokeStyle = decoration.options.overviewRulerOptions.color;
|
||||
this._ctx.strokeRect(
|
||||
0,
|
||||
Math.round(this._canvas.height * (decoration.options.marker.line / this._bufferService.buffers.active.lines.length)),
|
||||
|
||||
@@ -68,8 +68,9 @@ class Decoration extends Disposable implements IInternalDecoration {
|
||||
this.marker.onDispose(() => this.dispose());
|
||||
}
|
||||
public override dispose(): void {
|
||||
this.element?.remove();
|
||||
this._onDispose.fire();
|
||||
this.element?.remove();
|
||||
this.element = undefined;
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user