MCPcopy
hub / github.com/codeaashu/claude-code / deleteToLineStart

Method deleteToLineStart

src/utils/Cursor.ts:880–894  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 2

handleKeyDownFunction · 0.80
killToLineStartFunction · 0.80

Calls 3

leftMethod · 0.95
startOfLineMethod · 0.95
modifyTextMethod · 0.80

Tested by

no test coverage detected