MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / normalizeInputCursorForward

Function normalizeInputCursorForward

packages/core/src/runtime/inputEditor.ts:225–236  ·  view source on GitHub ↗
(value: string, cursor: number)

Source from the content-addressed store, hash-verified

223}
224
225function normalizeInputCursorForward(value: string, cursor: number): number {
226 const c = clampInputCursor(value, cursor);
227 if (c === 0 || c === value.length) return c;
228
229 let off = 0;
230 while (off < value.length) {
231 const end = nextClusterEnd(value, off);
232 if (end >= c) return end;
233 off = end;
234 }
235 return value.length;
236}
237
238export type InputSelection = Readonly<{ start: number; end: number }>;
239

Callers 1

applyInputEditEventFunction · 0.85

Calls 2

clampInputCursorFunction · 0.85
nextClusterEndFunction · 0.85

Tested by

no test coverage detected