MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / deleteWordBefore

Method deleteWordBefore

source code/utils/Cursor.ts:918–926  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

916 }
917
918 deleteWordBefore(): { cursor: Cursor; killed: string } {
919 if (this.isAtStart()) {
920 return { cursor: this, killed: '' }
921 }
922 const target = this.snapOutOfImageRef(this.prevWord().offset, 'start')
923 const prevWordCursor = new Cursor(this.measuredText, target)
924 const killed = this.text.slice(prevWordCursor.offset, this.offset)
925 return { cursor: prevWordCursor.modifyText(this), killed }
926 }
927
928 /**
929 * 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