MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / deleteWordLeft

Function deleteWordLeft

src/cli/components/editor-logic.ts:28–31  ·  view source on GitHub ↗
(text: string, cursor: number)

Source from the content-addressed store, hash-verified

26
27/** Delete the word immediately left of the cursor (Ctrl+W). Returns new text+cursor. */
28export function deleteWordLeft(text: string, cursor: number): { text: string; cursor: number } {
29 const start = wordLeft(text, cursor);
30 return { text: text.slice(0, start) + text.slice(cursor), cursor: start };
31}
32
33/** Insert `s` at `cursor`. Returns new text and the cursor after the inserted text. */
34export function insertAt(text: string, cursor: number, s: string): { text: string; cursor: number } {

Callers 2

ChatInputFunction · 0.85

Calls 1

wordLeftFunction · 0.85

Tested by

no test coverage detected