fix(InputHandler): clear wrap after EL1 full-line erase
CSI EL Ps=1 erases from the start of the row through the cursor. When the cursor is in the last column, that clears the entire row but did not clear isWrapped on the following line. eraseInDisplay Ps=1 already handled this case with ybase-aware indexing. Mirror that behavior in eraseInLine so soft-wrap chains stay consistent after erase-to-left at end of line. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -475,6 +475,13 @@ describe('InputHandler', () => {
|
||||
inputHandler.eraseInLine(Params.fromArray([1]));
|
||||
assert.equal(bufferService.buffer.lines.get(2)!.isWrapped, true);
|
||||
|
||||
// params[1] - full line erase at last column clears wrap on next line
|
||||
await resetToBaseState();
|
||||
bufferService.buffer.y = 1;
|
||||
bufferService.buffer.x = bufferService.cols - 1;
|
||||
inputHandler.eraseInLine(Params.fromArray([1]));
|
||||
assert.equal(bufferService.buffer.lines.get(2)!.isWrapped, false);
|
||||
|
||||
// params[2] - erase complete line
|
||||
await resetToBaseState();
|
||||
bufferService.buffer.y = 2;
|
||||
|
||||
@@ -1324,6 +1324,12 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
break;
|
||||
case 1:
|
||||
this._eraseInBufferLine(this._activeBuffer.y, 0, this._activeBuffer.x + 1, false, respectProtect);
|
||||
if (this._activeBuffer.x + 1 >= this._bufferService.cols) {
|
||||
const nextLine = this._activeBuffer.lines.get(this._activeBuffer.ybase + this._activeBuffer.y + 1);
|
||||
if (nextLine) {
|
||||
nextLine.isWrapped = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
this._eraseInBufferLine(this._activeBuffer.y, 0, this._bufferService.cols, true, respectProtect);
|
||||
|
||||
Reference in New Issue
Block a user