use decorations service instead of decorations render layer

This commit is contained in:
meganrogge
2022-02-02 20:51:28 -06:00
parent 5ccb41b9b9
commit 49085bbd5b
7 changed files with 26 additions and 53 deletions
+5 -1
View File
@@ -55,6 +55,7 @@ import { CoreTerminal } from 'common/CoreTerminal';
import { color, rgba } from 'browser/Color';
import { CharacterJoinerService } from 'browser/services/CharacterJoinerService';
import { toRgbString } from 'common/input/XParseColor';
import { DecorationsService, IDecorationsService } from 'browser/services/DecorationsService';
// Let it work inside Node.js for automated testing purposes.
const document: Document = (typeof window !== 'undefined') ? window.document : null as any;
@@ -80,6 +81,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
private _charSizeService: ICharSizeService | undefined;
private _mouseService: IMouseService | undefined;
private _renderService: IRenderService | undefined;
private _decorationsService: IDecorationsService | undefined;
private _characterJoinerService: ICharacterJoinerService | undefined;
private _selectionService: ISelectionService | undefined;
private _soundService: ISoundService | undefined;
@@ -513,6 +515,8 @@ export class Terminal extends CoreTerminal implements ITerminal {
this.register(this._renderService.onRenderedBufferChange(e => this._onRender.fire(e)));
this.onResize(e => this._renderService!.resize(e.cols, e.rows));
this._decorationsService = this.register(this._instantiationService.createInstance(DecorationsService, this.screenElement));
this._compositionView = document.createElement('div');
this._compositionView.classList.add('composition-view');
this._compositionHelper = this._instantiationService.createInstance(CompositionHelper, this.textarea, this._compositionView);
@@ -999,7 +1003,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
}
public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined {
return this._renderService?.registerDecoration(decorationOptions);
return this._decorationsService?.registerDecoration(decorationOptions);
}
/**
* Gets whether the terminal has an active selection.