diff --git a/src/browser/TestUtils.test.ts b/src/browser/TestUtils.test.ts index 8fdf458e..ee266e9c 100644 --- a/src/browser/TestUtils.test.ts +++ b/src/browser/TestUtils.test.ts @@ -254,6 +254,9 @@ export class MockBuffer implements IBuffer { public getWhitespaceCell(attr?: IAttributeData): ICellData { throw new Error('Method not implemented.'); } + public clearMarkers(): void { + throw new Error('Method not implemented.'); + } } export class MockRenderer implements IRenderer { diff --git a/src/common/buffer/Buffer.ts b/src/common/buffer/Buffer.ts index e348ad4c..eed16609 100644 --- a/src/common/buffer/Buffer.ts +++ b/src/common/buffer/Buffer.ts @@ -16,7 +16,6 @@ import { DEFAULT_CHARSET } from 'common/data/Charsets'; import { ExtendedAttrs } from 'common/buffer/AttributeData'; export const MAX_BUFFER_SIZE = 4294967295; // 2^32 - 1 -const enum BufferState { CLEARING = 'clearing' } /** * This class represents a terminal buffer (an internal state of the terminal), where the @@ -44,7 +43,7 @@ export class Buffer implements IBuffer { private _whitespaceCell: ICellData = CellData.fromCharData([0, WHITESPACE_CELL_CHAR, WHITESPACE_CELL_WIDTH, WHITESPACE_CELL_CODE]); private _cols: number; private _rows: number; - private _state: string | undefined; + private _isClearing: boolean = false; constructor( private _hasScrollback: boolean, @@ -587,12 +586,12 @@ export class Buffer implements IBuffer { } public clearMarkers(): void { - this._state = BufferState.CLEARING; + this._isClearing = true; for (const marker of this.markers) { marker.dispose(); } this.markers = []; - this._state = undefined; + this._isClearing = false; } public addMarker(y: number): Marker { @@ -626,7 +625,7 @@ export class Buffer implements IBuffer { } private _removeMarker(marker: Marker): void { - if (this._state !== BufferState.CLEARING) { + if (this._isClearing !== BufferState.CLEARING) { this.markers.splice(this.markers.indexOf(marker), 1); } }