( nextState: State, leadingSymbol: Doc.AnsiDoc, trailingSymbol: Doc.AnsiDoc, options: Options, submitted: boolean = false )
| 119 | } |
| 120 | |
| 121 | function renderOutput( |
| 122 | nextState: State, |
| 123 | leadingSymbol: Doc.AnsiDoc, |
| 124 | trailingSymbol: Doc.AnsiDoc, |
| 125 | options: Options, |
| 126 | submitted: boolean = false |
| 127 | ) { |
| 128 | const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold) |
| 129 | const promptLines = options.message.split(/\r?\n/) |
| 130 | const prefix = Doc.cat(leadingSymbol, Doc.space) |
| 131 | if (Arr.isNonEmptyReadonlyArray(promptLines)) { |
| 132 | const lines = Arr.map(promptLines, (line) => annotateLine(line)) |
| 133 | return prefix.pipe( |
| 134 | Doc.cat(Doc.nest(Doc.vsep(lines), 2)), |
| 135 | Doc.cat(Doc.space), |
| 136 | Doc.cat(trailingSymbol), |
| 137 | Doc.cat(Doc.space), |
| 138 | Doc.cat(renderInput(nextState, options, submitted)) |
| 139 | ) |
| 140 | } |
| 141 | return Doc.hsep([prefix, trailingSymbol, renderInput(nextState, options, submitted)]) |
| 142 | } |
| 143 | |
| 144 | function renderNextFrame(state: State, options: Options) { |
| 145 | return Effect.gen(function*() { |
no test coverage detected