Skip to content

Commit 594c58a

Browse files
43081jgithub-actions[bot]
authored andcommitted
[ci] format
1 parent c3666e2 commit 594c58a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/prompts/src/limit-options.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const limitOptions = <TOption>({
3939
output = process.stdout,
4040
maxItems = Number.POSITIVE_INFINITY,
4141
columnPadding = 0,
42-
rowPadding = 4
42+
rowPadding = 4,
4343
}: LimitOptionsParams<TOption>): string[] => {
4444
const columns = getColumns(output);
4545
const maxWidth = columns - columnPadding;
@@ -52,14 +52,20 @@ export const limitOptions = <TOption>({
5252
let slidingWindowLocation = 0;
5353

5454
if (cursor >= computedMaxItems - 3) {
55-
slidingWindowLocation = Math.max(Math.min(cursor - computedMaxItems + 3, options.length - computedMaxItems), 0);
55+
slidingWindowLocation = Math.max(
56+
Math.min(cursor - computedMaxItems + 3, options.length - computedMaxItems),
57+
0
58+
);
5659
}
5760

5861
let shouldRenderTopEllipsis = computedMaxItems < options.length && slidingWindowLocation > 0;
5962
let shouldRenderBottomEllipsis =
6063
computedMaxItems < options.length && slidingWindowLocation + computedMaxItems < options.length;
6164

62-
const slidingWindowLocationEnd = Math.min(slidingWindowLocation + computedMaxItems, options.length);
65+
const slidingWindowLocationEnd = Math.min(
66+
slidingWindowLocation + computedMaxItems,
67+
options.length
68+
);
6369
const lineGroups: Array<string[]> = [];
6470
let lineCount = 0;
6571
if (shouldRenderTopEllipsis) {

0 commit comments

Comments
 (0)