( state: FileState, files: ReadonlyArray<string>, figures: Theme, options: FileOptionsReq, renderOptions?: RenderOptions | undefined )
| 2473 | } |
| 2474 | |
| 2475 | const renderFiles = ( |
| 2476 | state: FileState, |
| 2477 | files: ReadonlyArray<string>, |
| 2478 | figures: Theme, |
| 2479 | options: FileOptionsReq, |
| 2480 | renderOptions?: RenderOptions | undefined |
| 2481 | ) => { |
| 2482 | const length = files.length |
| 2483 | if (length === 0) { |
| 2484 | return renderOptions?.plain === true |
| 2485 | ? FILE_EMPTY_MESSAGE |
| 2486 | : Ansi.annotate(figures.colors, FILE_EMPTY_MESSAGE, figures.mutedColor) |
| 2487 | } |
| 2488 | const toDisplay = entriesToDisplay(state.cursor, length, options.maxPerPage) |
| 2489 | const documents: Array<string> = [] |
| 2490 | for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) { |
| 2491 | const isSelected = state.cursor === index |
| 2492 | const prefix = renderPrefix(state, toDisplay, index, length, figures, renderOptions) |
| 2493 | const fileName = renderFileName(files[index], isSelected, figures, renderOptions) |
| 2494 | documents.push(prefix + fileName) |
| 2495 | } |
| 2496 | return documents.join("\n") |
| 2497 | } |
| 2498 | |
| 2499 | const renderFileNextFrame = Effect.fnUntraced(function*(state: FileState, options: FileOptionsReq) { |
| 2500 | const path = yield* Path.Path |
no test coverage detected