Fix dependency injection for decoration service

This commit is contained in:
Daniel Imms
2022-03-14 15:52:32 -07:00
parent 4b615f48ff
commit 65b9a6cfc4
5 changed files with 15 additions and 12 deletions
@@ -16,10 +16,10 @@ export class BufferDecorationRenderer extends Disposable {
private _altBufferIsActive: boolean = false;
constructor(
private readonly _screenElement: HTMLElement,
@IBufferService private readonly _bufferService: IBufferService,
@IRenderService private readonly _renderService: IRenderService,
private readonly _decorationService: IDecorationService,
private readonly _screenElement: HTMLElement
@IDecorationService private readonly _decorationService: IDecorationService,
@IRenderService private readonly _renderService: IRenderService
) {
super();
@@ -23,12 +23,12 @@ export class OverviewRulerRenderer extends Disposable {
private _x: number | undefined;
constructor(
private readonly _viewportElement: HTMLElement,
private readonly _screenElement: HTMLElement,
@IBufferService private readonly _bufferService: IBufferService,
@IRenderService private readonly _renderService: IRenderService,
@IDecorationService private readonly _decorationService: IDecorationService,
@IInstantiationService private readonly _instantiationService: IInstantiationService,
private readonly _viewportElement: HTMLElement,
private readonly _screenElement: HTMLElement
@IRenderService private readonly _renderService: IRenderService
) {
super();
this._canvas = document.createElement('canvas');
+3 -3
View File
@@ -587,14 +587,14 @@ export class Terminal extends CoreTerminal implements ITerminal {
this.linkifier.attachToDom(this.element, this._mouseZoneManager);
this.linkifier2.attachToDom(this.screenElement, this._mouseService, this._renderService);
if (this._decorationService) {
this._bufferDecorationRenderer = new BufferDecorationRenderer(this._bufferService, this._renderService, this._decorationService, this.screenElement);
this._bufferDecorationRenderer = this._instantiationService.createInstance(BufferDecorationRenderer, this.screenElement);
}
if (this.options.overviewRulerWidth && this._decorationService) {
this._overviewRulerRenderer = new OverviewRulerRenderer(this._bufferService, this._renderService, this._decorationService, this._instantiationService, this._viewportElement, this.screenElement);
this._overviewRulerRenderer = this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement);
}
this.optionsService.onOptionChange(() => {
if (!this._overviewRulerRenderer && this.options.overviewRulerWidth && this._renderService && this._viewportElement && this.screenElement && this._decorationService) {
this._overviewRulerRenderer = new OverviewRulerRenderer(this._bufferService, this._renderService, this._decorationService, this._instantiationService, this._viewportElement, this.screenElement);
this._overviewRulerRenderer = this._instantiationService.createInstance(OverviewRulerRenderer, this._viewportElement, this.screenElement);
}});
// This event listener must be registered aftre MouseZoneManager is created
this.register(addDisposableDomListener(this.element, 'mousedown', (e: MouseEvent) => this._selectionService!.onMouseDown(e)));