add to mockbuffer

This commit is contained in:
meganrogge
2022-03-02 20:19:49 -06:00
parent e75b47ca01
commit 82706e77db
2 changed files with 15 additions and 12 deletions
+4 -1
View File
@@ -257,7 +257,10 @@ export class MockBuffer implements IBuffer {
public getWhitespaceCell(attr?: IAttributeData): ICellData {
throw new Error('Method not implemented.');
}
public clearMarkers(): void {
public clearMarkers(y: number): void {
throw new Error('Method not implemented.');
}
public clearAllMarkers(excludeY: number): void {
throw new Error('Method not implemented.');
}
}
+11 -11
View File
@@ -591,12 +591,12 @@ export class Buffer implements IBuffer {
*/
public clearMarkers(y: number): void {
this._isClearing = true;
for (let i = 0; i < this.markers.length; i++) {
if (this.markers[i].line === y) {
this.markers[i].dispose();
this.markers.splice(i--, 1);
}
for (let i = 0; i < this.markers.length; i++) {
if (this.markers[i].line === y) {
this.markers[i].dispose();
this.markers.splice(i--, 1);
}
}
this._isClearing = false;
}
@@ -604,13 +604,13 @@ export class Buffer implements IBuffer {
* Clears markers on all lines except for those on a particular line.
* @param excludeY The line to exclude.
*/
public clearAllMarkers(excludeY: number): void {
public clearAllMarkers(excludeY: number): 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);
}
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._isClearing = false;
}