( state: FileState, files: ReadonlyArray<string>, figures: Effect.Success<typeof platformFigures>, options: FileOptionsReq, renderOptions?: RenderOptions | undefined )
| 2288 | } |
| 2289 | |
| 2290 | const renderFiles = ( |
| 2291 | state: FileState, |
| 2292 | files: ReadonlyArray<string>, |
| 2293 | figures: Effect.Success<typeof platformFigures>, |
| 2294 | options: FileOptionsReq, |
| 2295 | renderOptions?: RenderOptions | undefined |
| 2296 | ) => { |
| 2297 | const length = files.length |
| 2298 | if (length === 0) { |
| 2299 | return renderOptions?.plain === true |
| 2300 | ? FILE_EMPTY_MESSAGE |
| 2301 | : Ansi.annotate(FILE_EMPTY_MESSAGE, Ansi.blackBright) |
| 2302 | } |
| 2303 | const toDisplay = entriesToDisplay(state.cursor, length, options.maxPerPage) |
| 2304 | const documents: Array<string> = [] |
| 2305 | for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) { |
| 2306 | const isSelected = state.cursor === index |
| 2307 | const prefix = renderPrefix(state, toDisplay, index, length, figures, renderOptions) |
| 2308 | const fileName = renderFileName(files[index], isSelected, renderOptions) |
| 2309 | documents.push(prefix + fileName) |
| 2310 | } |
| 2311 | return documents.join("\n") |
| 2312 | } |
| 2313 | |
| 2314 | const renderFileNextFrame = Effect.fnUntraced(function*(state: FileState, options: FileOptionsReq) { |
| 2315 | const path = yield* Path.Path |
no test coverage detected