MCPcopy
hub / github.com/claude-code-best/claude-code / deleteWordBefore

Method deleteWordBefore

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

Source from the content-addressed store, hash-verified

889 }
890
891 deleteWordBefore(): { cursor: Cursor; killed: string } {
892 if (this.isAtStart()) {
893 return { cursor: this, killed: '' }
894 }
895 const target = this.snapOutOfImageRef(this.prevWord().offset, 'start')
896 const prevWordCursor = new Cursor(this.measuredText, target)
897 const killed = this.text.slice(prevWordCursor.offset, this.offset)
898 return { cursor: prevWordCursor.modifyText(this), killed }
899 }
900
901 /**
902 * Deletes a token before the cursor if one exists.

Callers 2

handleKeyDownFunction · 0.80
killWordBeforeFunction · 0.80

Calls 4

isAtStartMethod · 0.95
snapOutOfImageRefMethod · 0.95
prevWordMethod · 0.95
modifyTextMethod · 0.95

Tested by

no test coverage detected