[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

fix: missed symbols

Bruno Rocha (Aug 14, 2023, 3:39 PM -0300) 6490f0b8 bfbae952

+14 -9
+14 -9
packages/prompts/src/index.ts
··· 69 69 lineWrapper?: (line: string) => string; 70 70 } 71 71 ): string { 72 - const defaultSymbol = options?.defaultSymbol ?? color.gray(S_BAR); 73 - const initialSymbol = options?.initialSymbol ?? defaultSymbol; 74 - const newLineSymbol = options?.newLineSymbol ?? defaultSymbol; 75 - const endSymbol = options?.endSymbol ?? defaultSymbol; 76 - 77 72 const terminalWidth = process.stdout.columns || 80; 78 73 const maxWidth = options?.maxWidth ?? terminalWidth - 2; 79 74 ··· 96 91 formattedLines.push(currentLine); 97 92 } 98 93 94 + const defaultSymbol = options?.defaultSymbol ?? color.gray(S_BAR); 99 95 return formattedLines 100 96 .map((line, i, ar) => { 101 - const symbol = i === 0 ? initialSymbol : i + 1 === ar.length ? endSymbol : newLineSymbol; 97 + const symbol = 98 + i === 0 && i + 1 === ar.length 99 + ? options?.initialSymbol ?? options?.endSymbol ?? defaultSymbol 100 + : i === 0 101 + ? options?.initialSymbol ?? defaultSymbol 102 + : i + 1 === ar.length 103 + ? options?.endSymbol ?? defaultSymbol 104 + : options?.newLineSymbol ?? defaultSymbol; 102 105 const wrappedLine = options?.lineWrapper ? options.lineWrapper(line) : line; 103 106 const fullLine = wrappedLine + ' '.repeat(Math.max(maxWidth - strLength(wrappedLine), 0)); 104 107 return `${symbol} ${fullLine}`; ··· 378 381 } else { 379 382 return formatTextWithMaxWidth( 380 383 opt(option, i + slidingWindowLocation === this.cursor ? 'active' : 'inactive'), 381 - { defaultSymbol: color.cyan(S_BAR) } 384 + { 385 + defaultSymbol: color.cyan(S_BAR), 386 + } 382 387 ); 383 388 } 384 389 }) 385 390 .join('\n'), 386 - color.cyan(S_BAR_END), 391 + shouldRenderBottomEllipsis ? undefined : color.cyan(S_BAR_END), 387 392 ].join('\n'); 388 393 } 389 394 } ··· 564 569 return formatTextWithMaxWidth(line); 565 570 }) 566 571 .join('\n'), 567 - color.cyan(S_BAR_END), 572 + color.gray(S_BAR_END), 568 573 ].join('\n'); 569 574 } 570 575 }