From 34ec80a32288837feef857fb05248e9529615373 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Thu, 24 Feb 2022 12:02:11 -0600 Subject: [PATCH 1/2] use ybase + y when clearing markers --- src/common/InputHandler.ts | 2 +- src/common/buffer/Buffer.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/InputHandler.ts b/src/common/InputHandler.ts index 6198aa37..d5b8d948 100644 --- a/src/common/InputHandler.ts +++ b/src/common/InputHandler.ts @@ -1231,8 +1231,8 @@ export class InputHandler extends Disposable implements IInputHandler { private _resetBufferLine(y: number): void { const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!; line.fill(this._activeBuffer.getNullCell(this._eraseAttrData())); + this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y); line.isWrapped = false; - this._bufferService.buffer.clearMarkers(y); } /** diff --git a/src/common/buffer/Buffer.ts b/src/common/buffer/Buffer.ts index 7596fef3..2841efd8 100644 --- a/src/common/buffer/Buffer.ts +++ b/src/common/buffer/Buffer.ts @@ -591,7 +591,7 @@ export class Buffer implements IBuffer { 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.markers.splice(i, 1); } } } else { From ef0312473eccc47326828731d9eae36dbafcf035 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Thu, 24 Feb 2022 12:07:54 -0600 Subject: [PATCH 2/2] re-add i-- so that markers on the same line get disposed of --- src/common/buffer/Buffer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/buffer/Buffer.ts b/src/common/buffer/Buffer.ts index 2841efd8..7596fef3 100644 --- a/src/common/buffer/Buffer.ts +++ b/src/common/buffer/Buffer.ts @@ -591,7 +591,7 @@ export class Buffer implements IBuffer { 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.markers.splice(i--, 1); } } } else {