This commit is contained in:
meganrogge
2022-01-31 12:53:07 -06:00
parent 9b4801fb43
commit c5a0711f84
12 changed files with 135 additions and 118 deletions
+2 -3
View File
@@ -15,7 +15,7 @@ import { IBufferService, IOptionsService, ICoreService, IInstantiationService }
import { removeTerminalFromCache } from 'browser/renderer/atlas/CharAtlasCache';
import { EventEmitter, IEvent } from 'common/EventEmitter';
import { DecorationRenderLayer } from 'browser/renderer/DecorationRenderLayer';
import { IBufferDecorationOptions, IGutterDecorationOptions, IDecoration } from 'xterm';
import { IBufferDecorationOptions, IDecoration } from 'xterm';
let nextRendererId = 1;
@@ -68,12 +68,11 @@ export class Renderer extends Disposable implements IRenderer {
this.onOptionsChanged();
}
public registerDecoration(decorationOptions: IBufferDecorationOptions | IGutterDecorationOptions): IDecoration {
public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined {
const decorationLayer = this._renderLayers.find(l => l instanceof DecorationRenderLayer);
if (decorationLayer instanceof DecorationRenderLayer) {
return decorationLayer.registerDecoration(decorationOptions);
}
throw new Error('no decoration layer');
}
public dispose(): void {