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

Function apply

src/cli/components/chat-input.tsx:59–64  ·  view source on GitHub ↗
(t: string, c: number)

Source from the content-addressed store, hash-verified

57 }, [value]);
58
59 const apply = (t: string, c: number) => {
60 onChange(t);
61 setCursor(Math.max(0, Math.min(c, t.length)));
62 setAnchor(null); // any edit collapses the selection
63 histIdx.current = null; // and drops out of history-recall mode
64 };
65
66 // Selection = the half-open range [min(anchor,cursor), max(anchor,cursor)).
67 const hasSelection = anchor !== null && anchor !== cursor;

Callers 1

ChatInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected