( state: MultiSelectState, pointer: string, theme: Theme, renderOptions?: RenderOptions | undefined )
| 2728 | } |
| 2729 | |
| 2730 | const renderMultiSelectError = ( |
| 2731 | state: MultiSelectState, |
| 2732 | pointer: string, |
| 2733 | theme: Theme, |
| 2734 | renderOptions?: RenderOptions | undefined |
| 2735 | ): string => { |
| 2736 | if (Option.isSome(state.error)) { |
| 2737 | return Arr.match(state.error.value.split(NEWLINE_REGEXP), { |
| 2738 | onEmpty: () => "", |
| 2739 | onNonEmpty: (errorLines) => { |
| 2740 | if (renderOptions?.plain === true) { |
| 2741 | return separateSymbol(pointer, errorLines.join("\n")) |
| 2742 | } |
| 2743 | const prefix = annotateSymbol(theme, pointer, theme.errorColor) |
| 2744 | const lines = Arr.map(errorLines, (str) => annotateErrorLine(theme, str)) |
| 2745 | return Ansi.cursorSavePosition + "\n" + separateSymbol(prefix, lines.join("\n")) + Ansi.cursorRestorePosition |
| 2746 | } |
| 2747 | }) |
| 2748 | } |
| 2749 | return "" |
| 2750 | } |
| 2751 | |
| 2752 | const renderChoiceDescription = <A>( |
| 2753 | choice: SelectChoice<A>, |
no test coverage detected