clear all markers (#3868)

This commit is contained in:
Megan Rogge
2022-06-21 18:26:02 +00:00
committed by GitHub
parent 4cdf308c2f
commit 52044e9aad
4 changed files with 9 additions and 12 deletions
+1 -1
View File
@@ -1325,7 +1325,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
// Don't clear if it's already clear
return;
}
this.buffer.clearAllMarkers(0);
this.buffer.clearAllMarkers();
this.buffer.lines.set(0, this.buffer.lines.get(this.buffer.ybase + this.buffer.y)!);
this.buffer.lines.length = 1;
this.buffer.ydisp = 0;
+1 -1
View File
@@ -262,7 +262,7 @@ export class MockBuffer implements IBuffer {
public clearMarkers(y: number): void {
throw new Error('Method not implemented.');
}
public clearAllMarkers(excludeY: number): void {
public clearAllMarkers(): void {
throw new Error('Method not implemented.');
}
}
+5 -8
View File
@@ -601,16 +601,13 @@ export class Buffer implements IBuffer {
}
/**
* Clears markers on all lines except for those on a particular line.
* @param excludeY The line to exclude.
* Clears markers on all lines
*/
public clearAllMarkers(excludeY: number): void {
public clearAllMarkers(): void {
this._isClearing = true;
for (let i = 0; i < this.markers.length; i++) {
if (this.markers[i].line !== excludeY) {
this.markers[i].dispose();
this.markers.splice(i--, 1);
}
this.markers[i].dispose();
this.markers.splice(i--, 1);
}
this._isClearing = false;
}
@@ -671,7 +668,7 @@ export class Buffer implements IBuffer {
export class BufferStringIterator implements IBufferStringIterator {
private _current: number;
constructor (
constructor(
private _buffer: IBuffer,
private _trimRight: boolean,
private _startIndex: number = 0,
+2 -2
View File
@@ -10,7 +10,7 @@ import { IEvent } from 'common/EventEmitter';
export type BufferIndex = [number, number];
export interface IBufferStringIteratorResult {
range: {first: number, last: number};
range: { first: number, last: number };
content: string;
}
@@ -46,7 +46,7 @@ export interface IBuffer {
getWhitespaceCell(attr?: IAttributeData): ICellData;
addMarker(y: number): IMarker;
clearMarkers(y: number): void;
clearAllMarkers(excludeY: number): void;
clearAllMarkers(): void;
}
export interface IBufferSet extends IDisposable {