From cae9f44f5c065d04588ee5ddaa4a7266a70a3b86 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 8 Feb 2022 11:45:22 -0600 Subject: [PATCH] remove mention of buffer --- addons/xterm-addon-webgl/src/WebglRenderer.ts | 2 +- src/browser/Terminal.ts | 4 ++-- src/browser/TestUtils.test.ts | 8 +++---- src/browser/Types.d.ts | 4 ++-- src/browser/public/Terminal.ts | 4 ++-- src/browser/renderer/Renderer.ts | 2 +- src/browser/renderer/Types.d.ts | 2 +- src/browser/renderer/dom/DomRenderer.ts | 4 ++-- src/browser/services/DecorationsService.ts | 22 +++++++++---------- src/browser/services/RenderService.ts | 2 +- src/browser/services/Services.ts | 2 +- typings/xterm.d.ts | 17 ++------------ 12 files changed, 30 insertions(+), 43 deletions(-) diff --git a/addons/xterm-addon-webgl/src/WebglRenderer.ts b/addons/xterm-addon-webgl/src/WebglRenderer.ts index 92b28aa4e..a1c1751f1 100644 --- a/addons/xterm-addon-webgl/src/WebglRenderer.ts +++ b/addons/xterm-addon-webgl/src/WebglRenderer.ts @@ -13,7 +13,7 @@ import { IWebGL2RenderingContext } from './Types'; import { RenderModel, COMBINED_CHAR_BIT_MASK, RENDER_MODEL_BG_OFFSET, RENDER_MODEL_FG_OFFSET, RENDER_MODEL_INDICIES_PER_CELL } from './RenderModel'; import { Disposable } from 'common/Lifecycle'; import { Content, NULL_CELL_CHAR, NULL_CELL_CODE } from 'common/buffer/Constants'; -import { Terminal, IEvent, IBufferDecorationOptions, IDecoration } from 'xterm'; +import { Terminal, IEvent, IDecorationOptions, IDecoration } from 'xterm'; import { IRenderLayer } from './renderLayer/Types'; import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/Types'; import { ITerminal, IColorSet } from 'browser/Types'; diff --git a/src/browser/Terminal.ts b/src/browser/Terminal.ts index cf95af595..e2a29f02d 100644 --- a/src/browser/Terminal.ts +++ b/src/browser/Terminal.ts @@ -37,7 +37,7 @@ import * as Strings from 'browser/LocalizableStrings'; import { SoundService } from 'browser/services/SoundService'; import { MouseZoneManager } from 'browser/MouseZoneManager'; import { AccessibilityManager } from './AccessibilityManager'; -import { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider, IBufferDecorationOptions, IDecoration } from 'xterm'; +import { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm'; import { DomRenderer } from 'browser/renderer/dom/DomRenderer'; import { KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, ScrollSource, IColorEvent, ColorIndex, ColorRequestType } from 'common/Types'; import { evaluateKeyboardEvent } from 'common/input/Keyboard'; @@ -1006,7 +1006,7 @@ export class Terminal extends CoreTerminal implements ITerminal { return this.buffer.addMarker(this.buffer.ybase + this.buffer.y + cursorYOffset); } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined { if (!this._decorationsService) { throw new Error('cannot register a decoration without a decorations service'); } diff --git a/src/browser/TestUtils.test.ts b/src/browser/TestUtils.test.ts index 61b6c0d75..d6d4b95ea 100644 --- a/src/browser/TestUtils.test.ts +++ b/src/browser/TestUtils.test.ts @@ -3,7 +3,7 @@ * @license MIT */ -import { IDisposable, IMarker, ISelectionPosition, ILinkProvider, IBufferDecorationOptions, IDecoration } from 'xterm'; +import { IDisposable, IMarker, ISelectionPosition, ILinkProvider, IDecorationOptions, IDecoration } from 'xterm'; import { IEvent, EventEmitter } from 'common/EventEmitter'; import { ICharacterJoinerService, ICharSizeService, IMouseService, IRenderService, ISelectionService } from 'browser/services/Services'; import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/Types'; @@ -102,7 +102,7 @@ export class MockTerminal implements ITerminal { public registerLinkProvider(linkProvider: ILinkProvider): IDisposable { throw new Error('Method not implemented.'); } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined { throw new Error('Method not implemented.'); } public hasSelection(): boolean { @@ -296,7 +296,7 @@ export class MockRenderer implements IRenderer { public onDevicePixelRatioChange(): void { } public clear(): void { } public renderRows(start: number, end: number): void { } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration { throw new Error('Method not implemented.'); } } @@ -428,7 +428,7 @@ export class MockRenderService implements IRenderService { public dispose(): void { throw new Error('Method not implemented.'); } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration { throw new Error('Method not implemented.'); } } diff --git a/src/browser/Types.d.ts b/src/browser/Types.d.ts index 69ba3047e..f61526593 100644 --- a/src/browser/Types.d.ts +++ b/src/browser/Types.d.ts @@ -3,7 +3,7 @@ * @license MIT */ -import { IBufferDecorationOptions, IDecoration, IDisposable, IMarker, ISelectionPosition } from 'xterm'; +import { IDecorationOptions, IDecoration, IDisposable, IMarker, ISelectionPosition } from 'xterm'; import { IEvent } from 'common/EventEmitter'; import { ICoreTerminal, CharData, ITerminalOptions } from 'common/Types'; import { IMouseService, IRenderService } from './services/Services'; @@ -61,7 +61,7 @@ export interface IPublicTerminal extends IDisposable { registerCharacterJoiner(handler: (text: string) => [number, number][]): number; deregisterCharacterJoiner(joinerId: number): void; addMarker(cursorYOffset: number): IMarker | undefined; - registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined; + registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined; hasSelection(): boolean; getSelection(): string; getSelectionPosition(): ISelectionPosition | undefined; diff --git a/src/browser/public/Terminal.ts b/src/browser/public/Terminal.ts index c641f5f15..1c4c653ba 100644 --- a/src/browser/public/Terminal.ts +++ b/src/browser/public/Terminal.ts @@ -3,7 +3,7 @@ * @license MIT */ -import { Terminal as ITerminalApi, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBufferNamespace as IBufferNamespaceApi, IParser, ILinkProvider, IUnicodeHandling, FontWeight, IModes, IBufferDecorationOptions, IDecoration } from 'xterm'; +import { Terminal as ITerminalApi, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBufferNamespace as IBufferNamespaceApi, IParser, ILinkProvider, IUnicodeHandling, FontWeight, IModes, IDecorationOptions, IDecoration } from 'xterm'; import { ITerminal } from 'browser/Types'; import { Terminal as TerminalCore } from 'browser/Terminal'; import * as Strings from 'browser/LocalizableStrings'; @@ -171,7 +171,7 @@ export class Terminal implements ITerminalApi { this._verifyIntegers(cursorYOffset); return this._core.addMarker(cursorYOffset); } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined { this._checkProposedApi(); return this._core.registerDecoration(decorationOptions); } diff --git a/src/browser/renderer/Renderer.ts b/src/browser/renderer/Renderer.ts index 305808a2a..a58893b4c 100644 --- a/src/browser/renderer/Renderer.ts +++ b/src/browser/renderer/Renderer.ts @@ -14,7 +14,7 @@ import { ICharSizeService } from 'browser/services/Services'; import { IBufferService, IOptionsService, IInstantiationService } from 'common/services/Services'; import { removeTerminalFromCache } from 'browser/renderer/atlas/CharAtlasCache'; import { EventEmitter, IEvent } from 'common/EventEmitter'; -import { IBufferDecorationOptions, IDecoration } from 'xterm'; +import { IDecorationOptions, IDecoration } from 'xterm'; let nextRendererId = 1; diff --git a/src/browser/renderer/Types.d.ts b/src/browser/renderer/Types.d.ts index c53871734..ab6f8df14 100644 --- a/src/browser/renderer/Types.d.ts +++ b/src/browser/renderer/Types.d.ts @@ -6,7 +6,7 @@ import { IDisposable } from 'common/Types'; import { IColorSet } from 'browser/Types'; import { IEvent } from 'common/EventEmitter'; -import { IBufferDecorationOptions, IDecoration } from 'xterm'; +import { IDecorationOptions, IDecoration } from 'xterm'; export interface IRenderDimensions { scaledCharWidth: number; diff --git a/src/browser/renderer/dom/DomRenderer.ts b/src/browser/renderer/dom/DomRenderer.ts index 2057c791e..d3d3fb3ca 100644 --- a/src/browser/renderer/dom/DomRenderer.ts +++ b/src/browser/renderer/dom/DomRenderer.ts @@ -13,7 +13,7 @@ import { IOptionsService, IBufferService, IInstantiationService } from 'common/s import { EventEmitter, IEvent } from 'common/EventEmitter'; import { color } from 'browser/Color'; import { removeElementFromParent } from 'browser/Dom'; -import { IBufferDecorationOptions, IDecoration } from 'xterm'; +import { IDecorationOptions, IDecoration } from 'xterm'; const TERMINAL_CLASS_PREFIX = 'xterm-dom-renderer-owner-'; const ROW_CONTAINER_CLASS = 'xterm-rows'; @@ -152,7 +152,7 @@ export class DomRenderer extends Disposable implements IRenderer { this._injectCss(); } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration { // const decorationLayer = this._renderLayers.find(l => l instanceof DecorationRenderLayer); // if (decorationLayer instanceof DecorationRenderLayer) { // return decorationLayer.registerDecoration(decorationOptions); diff --git a/src/browser/services/DecorationsService.ts b/src/browser/services/DecorationsService.ts index ff617cb16..83b94a209 100644 --- a/src/browser/services/DecorationsService.ts +++ b/src/browser/services/DecorationsService.ts @@ -7,19 +7,19 @@ import { IRenderService } from 'browser/services/Services'; import { EventEmitter, IEvent } from 'common/EventEmitter'; import { Disposable } from 'common/Lifecycle'; import { createDecorator } from 'common/services/ServiceRegistry'; -import { IBufferService, ILogService } from 'common/services/Services'; +import { IBufferService } from 'common/services/Services'; import { IDisposable } from 'common/Types'; -import { IBufferDecorationOptions, IDecoration, IMarker } from 'xterm'; +import { IDecorationOptions, IDecoration, IMarker } from 'xterm'; export interface IDecorationsService extends IDisposable { - registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined; + registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined; refresh(): void; dispose(): void; } export class DecorationsService extends Disposable implements IDecorationsService { - private _decorations: BufferDecoration[] = []; + private _decorations: Decoration[] = []; private _animationFrame: number | undefined; constructor( @@ -30,13 +30,13 @@ export class DecorationsService extends Disposable implements IDecorationsServic super(); } - public registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined { + public registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined { if (decorationOptions.marker.isDisposed) { return undefined; } - const bufferDecoration = new BufferDecoration(decorationOptions, this._screenElement, this._renderService, this._bufferService); - this._decorations.push(bufferDecoration); - return bufferDecoration; + const decoration = new Decoration(decorationOptions, this._screenElement, this._renderService, this._bufferService); + this._decorations.push(decoration); + return decoration; } public refresh(): void { @@ -68,11 +68,11 @@ export class DecorationsService extends Disposable implements IDecorationsServic } export const IDecorationsService = createDecorator('DecorationsService'); -class BufferDecoration extends Disposable implements IDecoration { +class Decoration extends Disposable implements IDecoration { private static _nextId = 1; private _marker: IMarker; private _element: HTMLElement | undefined; - private _id: number = BufferDecoration._nextId++; + private _id: number = Decoration._nextId++; public isDisposed: boolean = false; public get id(): number { return this._id; } @@ -86,7 +86,7 @@ class BufferDecoration extends Disposable implements IDecoration { public get onRender(): IEvent { return this._onRender.event; } constructor( - private readonly _decorationOptions: IBufferDecorationOptions, + private readonly _decorationOptions: IDecorationOptions, private readonly _screenElement: HTMLElement, private readonly _renderService: IRenderService, private readonly _bufferService: IBufferService diff --git a/src/browser/services/RenderService.ts b/src/browser/services/RenderService.ts index 79faf18ad..8c5ff24db 100644 --- a/src/browser/services/RenderService.ts +++ b/src/browser/services/RenderService.ts @@ -12,7 +12,7 @@ import { addDisposableDomListener } from 'browser/Lifecycle'; import { IColorSet, IRenderDebouncer } from 'browser/Types'; import { IOptionsService, IBufferService } from 'common/services/Services'; import { ICharSizeService, IRenderService } from 'browser/services/Services'; -import { IDecoration, IBufferDecorationOptions } from 'xterm'; +import { IDecoration, IDecorationOptions } from 'xterm'; interface ISelectionState { start: [number, number] | undefined; diff --git a/src/browser/services/Services.ts b/src/browser/services/Services.ts index 8b7a0a77a..25775d05b 100644 --- a/src/browser/services/Services.ts +++ b/src/browser/services/Services.ts @@ -9,7 +9,7 @@ import { IColorSet } from 'browser/Types'; import { ISelectionRedrawRequestEvent as ISelectionRequestRedrawEvent, ISelectionRequestScrollLinesEvent } from 'browser/selection/Types'; import { createDecorator } from 'common/services/ServiceRegistry'; import { IDisposable } from 'common/Types'; -import { IBufferDecorationOptions, IDecoration } from 'xterm'; +import { IDecorationOptions, IDecoration } from 'xterm'; export const ICharSizeService = createDecorator('CharSizeService'); export interface ICharSizeService { diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index a7f80a159..0b3db559b 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -434,7 +434,7 @@ declare module 'xterm' { readonly element: HTMLElement | undefined; } - export interface IBufferDecorationOptions { + export interface IDecorationOptions { /** * The line in the terminal where * the decoration will be displayed @@ -467,19 +467,6 @@ declare module 'xterm' { } - export interface IGutterDecorationOptions { - /** - * The line in the terminal where - * the decoration will be displayed - */ - startMarker: IMarker; - /** - * The end line in the terminal for - * the decoration - */ - endMarker: IMarker; - } - /** * The set of localizable strings. */ @@ -951,7 +938,7 @@ declare module 'xterm' { * width, height, and x offset from the anchor. Returns the decoration or * undefined if the marker has already been disposed of. */ - registerDecoration(decorationOptions: IBufferDecorationOptions): IDecoration | undefined; + registerDecoration(decorationOptions: IDecorationOptions): IDecoration | undefined; /** * Gets whether the terminal has an active selection.