mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
clear all markers (#3868)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Vendored
+2
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user