fix(InputHandler): use ybase when clearing wrap after ED 1

eraseInDisplay Ps=1 clears from the start of the viewport through the
cursor. When the cursor is in the last column, the following line's
isWrapped flag must be cleared because the erased line can no longer
continue a wrapped row.

_eraseInBufferLine already addresses buffer lines with ybase + y, but
the next-line lookup used lines.get(j + 1) without ybase. With
scrollback (ybase > 0), that touched the wrong line and left incorrect
wrap state on the line below the cursor.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Daniel Imms
2026-06-03 03:36:34 +00:00
committed by Cursor Agent
co-authored by Cursor
parent ea75b99e2b
commit ade9a5a091
+1 -1
View File
@@ -1246,7 +1246,7 @@ export class InputHandler extends Disposable implements IInputHandler {
this._eraseInBufferLine(j, 0, this._activeBuffer.x + 1, true, respectProtect);
if (this._activeBuffer.x + 1 >= this._bufferService.cols) {
// Deleted entire previous line. This next line can no longer be wrapped.
const nextLine = this._activeBuffer.lines.get(j + 1);
const nextLine = this._activeBuffer.lines.get(this._activeBuffer.ybase + j + 1);
if (nextLine) {
nextLine.isWrapped = false;
}