()
| 878 | } |
| 879 | |
| 880 | deleteToLineStart(): { cursor: Cursor; killed: string } { |
| 881 | // If cursor is right after a newline (at start of line), delete just that |
| 882 | // newline — symmetric with deleteToLineEnd's newline handling. This lets |
| 883 | // repeated ctrl+u clear across lines. |
| 884 | if (this.offset > 0 && this.text[this.offset - 1] === '\n') { |
| 885 | return { cursor: this.left().modifyText(this), killed: '\n' } |
| 886 | } |
| 887 | |
| 888 | // Use startOfLine() so that at column 0 of a wrapped visual line, |
| 889 | // the cursor moves to the previous visual line's start instead of |
| 890 | // getting stuck. |
| 891 | const startCursor = this.startOfLine() |
| 892 | const killed = this.text.slice(startCursor.offset, this.offset) |
| 893 | return { cursor: startCursor.modifyText(this), killed } |
| 894 | } |
| 895 | |
| 896 | deleteToLineEnd(): { cursor: Cursor; killed: string } { |
| 897 | // If cursor is on a newline character, delete just that character |
no test coverage detected