mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
fix test and improve name
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user