(state: State, options: SelectOptions<A>)
| 153 | } |
| 154 | |
| 155 | function renderNextFrame<A>(state: State, options: SelectOptions<A>) { |
| 156 | return Effect.gen(function*() { |
| 157 | const terminal = yield* Terminal.Terminal |
| 158 | const columns = yield* terminal.columns |
| 159 | const figures = yield* InternalAnsiUtils.figures |
| 160 | const choices = renderChoices(state, options, figures) |
| 161 | const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyanBright) |
| 162 | const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright) |
| 163 | const promptMsg = renderOutput(leadingSymbol, trailingSymbol, options) |
| 164 | const error = renderError(state, figures.pointer) |
| 165 | return Doc.cursorHide.pipe( |
| 166 | Doc.cat(promptMsg), |
| 167 | Doc.cat(Doc.hardLine), |
| 168 | Doc.cat(choices), |
| 169 | Doc.cat(error), |
| 170 | Doc.render({ style: "pretty", options: { lineWidth: columns } }) |
| 171 | ) |
| 172 | }) |
| 173 | } |
| 174 | |
| 175 | function renderSubmission<A>(state: State, options: SelectOptions<A>) { |
| 176 | return Effect.gen(function*() { |
no test coverage detected