( state: State, files: ReadonlyArray<string>, figures: Effect.Effect.Success<typeof InternalAnsiUtils.figures>, options: FileOptions )
| 156 | } |
| 157 | |
| 158 | function renderFiles( |
| 159 | state: State, |
| 160 | files: ReadonlyArray<string>, |
| 161 | figures: Effect.Effect.Success<typeof InternalAnsiUtils.figures>, |
| 162 | options: FileOptions |
| 163 | ) { |
| 164 | const length = files.length |
| 165 | const toDisplay = entriesToDisplay(state.cursor, length, options.maxPerPage) |
| 166 | const documents: Array<Doc.AnsiDoc> = [] |
| 167 | for (let index = toDisplay.startIndex; index < toDisplay.endIndex; index++) { |
| 168 | const isSelected = state.cursor === index |
| 169 | const prefix = renderPrefix(state, toDisplay, index, length, figures) |
| 170 | const fileName = renderFileName(files[index], isSelected) |
| 171 | documents.push(Doc.cat(prefix, fileName)) |
| 172 | } |
| 173 | return Doc.vsep(documents) |
| 174 | } |
| 175 | |
| 176 | function renderNextFrame(state: State, options: FileOptions) { |
| 177 | return Effect.gen(function*() { |
no test coverage detected