MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / getKittyImageReservedRows

Method getKittyImageReservedRows

packages/pi-tui/src/tui.ts:1134–1146  ·  view source on GitHub ↗
(lines: string[], index: number, maxIndex = lines.length - 1)

Source from the content-addressed store, hash-verified

1132 }
1133
1134 private getKittyImageReservedRows(lines: string[], index: number, maxIndex = lines.length - 1): number {
1135 const rows = extractKittyImageRows(lines[index] ?? "");
1136 if (rows <= 1) return 1;
1137
1138 const maxRows = Math.min(rows, maxIndex - index + 1, lines.length - index);
1139 let reservedRows = 1;
1140 while (reservedRows < maxRows) {
1141 const line = lines[index + reservedRows] ?? "";
1142 if (isImageLine(line) || visibleWidth(line) > 0) break;
1143 reservedRows++;
1144 }
1145 return reservedRows;
1146 }
1147
1148 private expandChangedRangeForKittyImages(
1149 firstChanged: number,

Callers 4

expandForLinesMethod · 0.95
fullRenderMethod · 0.95
repaintViewportMethod · 0.95
doRenderMethod · 0.95

Calls 3

isImageLineFunction · 0.90
visibleWidthFunction · 0.90
extractKittyImageRowsFunction · 0.85

Tested by

no test coverage detected