diff --git a/src/browser/TestUtils.test.ts b/src/browser/TestUtils.test.ts index 10a1435b..ac048be6 100644 --- a/src/browser/TestUtils.test.ts +++ b/src/browser/TestUtils.test.ts @@ -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.'); } } diff --git a/src/common/buffer/Buffer.ts b/src/common/buffer/Buffer.ts index bf9d24ce..ab295784 100644 --- a/src/common/buffer/Buffer.ts +++ b/src/common/buffer/Buffer.ts @@ -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; }