File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments