Skip to content

Commit ffc7c0a

Browse files
committed
perf(repl): count Entries rows without building controls
1 parent cee01a4 commit ffc7c0a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12668,7 +12668,11 @@ function bindingsWindow(view: ReplView, widths: ReplMeasuredWidths, capacity: nu
1266812668
* the column by exactly one row.
1266912669
*/
1267012670
export function entriesRowCount(model: ReplModel): number {
12671-
return entryContent(model, undefined, undefined, undefined).length;
12671+
return model.entries.reduce((count, entry) => count + scopeRowCount(entry.scope), 0);
12672+
}
12673+
12674+
function scopeRowCount(scope: ReplScope): number {
12675+
return scope.scopes.reduce((count, child) => count + scopeRowCount(child), 1);
1267212676
}
1267312677

1267412678
/**

0 commit comments

Comments
 (0)