( state: State, leadingSymbol: Doc.AnsiDoc, trailingSymbol: Doc.AnsiDoc, options: IntegerOptions, submitted: boolean = false )
| 88 | } |
| 89 | |
| 90 | function renderOutput( |
| 91 | state: State, |
| 92 | leadingSymbol: Doc.AnsiDoc, |
| 93 | trailingSymbol: Doc.AnsiDoc, |
| 94 | options: IntegerOptions, |
| 95 | submitted: boolean = false |
| 96 | ) { |
| 97 | const annotateLine = (line: string): Doc.AnsiDoc => Doc.annotate(Doc.text(line), Ansi.bold) |
| 98 | const prefix = Doc.cat(leadingSymbol, Doc.space) |
| 99 | return Arr.match(options.message.split(/\r?\n/), { |
| 100 | onEmpty: () => Doc.hsep([prefix, trailingSymbol, renderInput(state, submitted)]), |
| 101 | onNonEmpty: (promptLines) => { |
| 102 | const lines = Arr.map(promptLines, (line) => annotateLine(line)) |
| 103 | return prefix.pipe( |
| 104 | Doc.cat(Doc.nest(Doc.vsep(lines), 2)), |
| 105 | Doc.cat(Doc.space), |
| 106 | Doc.cat(trailingSymbol), |
| 107 | Doc.cat(Doc.space), |
| 108 | Doc.cat(renderInput(state, submitted)) |
| 109 | ) |
| 110 | } |
| 111 | }) |
| 112 | } |
| 113 | |
| 114 | function renderNextFrame(state: State, options: IntegerOptions) { |
| 115 | return Effect.gen(function*() { |
no test coverage detected
searching dependent graphs…