Description
EditBufferRenderable.deleteToLineStart() only deletes when cursor.col > 0. When the cursor is already at column 0 (e.g. after a previous delete-to-line-start cleared the line content), pressing Ctrl+U again does nothing. It should join with the previous line by removing the newline character, similar to how deleteCharBackward() works at column 0.
Current behavior
line 1
line 2
|line 3 <- cursor at col 0, row 2
Pressing Ctrl+U → nothing happens (stuck).
Expected behavior
Pressing Ctrl+U at col 0 should delete the newline before the cursor, joining with the previous line:
line 1
line 2|line 3 <- cursor now at end of "line 2"
Root cause
In EditBufferRenderable.deleteToLineStart():
deleteToLineStart() {
const cursor = this.editorView.getCursor();
if (cursor.col > 0) { // <-- skips when col === 0
this.editBuffer.deleteRange(cursor.row, 0, cursor.row, cursor.col);
}
this.requestRender();
return true;
}
The cursor.col > 0 guard prevents any action when the cursor is at the start of a line. When col === 0 and row > 0, it should delete the newline to join with the previous line.
Description
EditBufferRenderable.deleteToLineStart()only deletes whencursor.col > 0. When the cursor is already at column 0 (e.g. after a previous delete-to-line-start cleared the line content), pressing Ctrl+U again does nothing. It should join with the previous line by removing the newline character, similar to howdeleteCharBackward()works at column 0.Current behavior
Pressing Ctrl+U → nothing happens (stuck).
Expected behavior
Pressing Ctrl+U at col 0 should delete the newline before the cursor, joining with the previous line:
Root cause
In
EditBufferRenderable.deleteToLineStart():The
cursor.col > 0guard prevents any action when the cursor is at the start of a line. Whencol === 0androw > 0, it should delete the newline to join with the previous line.