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

Method deleteWordBefore

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

Source from the content-addressed store, hash-verified

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