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

Function physicalRows

src/setup/prompt.ts:49–52  ·  view source on GitHub ↗
(s: string, cols: number)

Source from the content-addressed store, hash-verified

47 * move the cursor up by the right amount — counting logical lines undercounts when
48 * long options (e.g. long base URLs) wrap, leaving stale rows that pile up. */
49export function physicalRows(s: string, cols: number): number {
50 if (cols <= 0) return 1;
51 return Math.max(1, Math.ceil(displayWidth(s) / cols));
52}
53
54/** Compute the next highlighted index for a keypress. Returns the same index for no-op keys. Pure → testable. */
55export function moveSelection(current: number, keyName: string | undefined, len: number): number {

Callers 1

emitFunction · 0.70

Calls 1

displayWidthFunction · 0.85

Tested by

no test coverage detected