fix test and improve name

This commit is contained in:
meganrogge
2022-02-04 17:39:37 -06:00
parent f3bd1e24b7
commit 8999d3948a
2 changed files with 7 additions and 5 deletions
+3
View File
@@ -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 {
+4 -5
View File
@@ -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);
}
}