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

Function backspace

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

Source from the content-addressed store, hash-verified

38
39/** Backspace one char left of cursor. */
40export function backspace(text: string, cursor: number): { text: string; cursor: number } {
41 if (cursor <= 0) return { text, cursor: 0 };
42 return { text: text.slice(0, cursor - 1) + text.slice(cursor), cursor: cursor - 1 };
43}
44
45/** Delete the half-open range [from,to) (order-independent). Returns text + cursor at range start. */
46export function deleteRange(text: string, from: number, to: number): { text: string; cursor: number } {

Callers 2

ChatInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected