Skip to content

Commit 9a2ffe1

Browse files
committed
perf(repl): share the grown composer presentation
1 parent 9cee99f commit 9a2ffe1

1 file changed

Lines changed: 8 additions & 24 deletions

File tree

‎packages/cli/src/repl/program.ts‎

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6314,30 +6314,6 @@ export function* prepareFrame(
63146314
// One more structural measurement when the composer is taller than the
63156315
// minimum, so the capacity the chat is admitted against is the capacity of
63166316
// the frame that will actually be drawn. Bounded: one pass, never a loop.
6317-
const geometry =
6318-
shown === undefined || shown.length <= 1
6319-
? third
6320-
: yield* renderer.measure(
6321-
skeletonOps(
6322-
presentationFor(
6323-
view,
6324-
queuing(
6325-
measuringAt(
6326-
widths,
6327-
windowed,
6328-
entriesRows,
6329-
guidanceRows?.length ?? 1,
6330-
shown.length,
6331-
envelope,
6332-
),
6333-
),
6334-
).manifest.root,
6335-
),
6336-
view.size,
6337-
);
6338-
if (!geometry.ok) {
6339-
return geometry;
6340-
}
63416317
const placed =
63426318
shown === undefined || shown.length <= 1
63436319
? measured
@@ -6354,6 +6330,14 @@ export function* prepareFrame(
63546330
),
63556331
),
63566332
);
6333+
6334+
const geometry =
6335+
placed === measured
6336+
? third
6337+
: yield* renderer.measure(skeletonOps(placed.manifest.root), view.size);
6338+
if (!geometry.ok) {
6339+
return geometry;
6340+
}
63576341
// The History band, measured against the terminal's own width. Prepared
63586342
// beside the reading: where a mark lands is a proportion of the rail's
63596343
// measured columns, so the pass that asks how wide the band is cannot

0 commit comments

Comments
 (0)