| 2246 | } |
| 2247 | |
| 2248 | const renderPrefix = ( |
| 2249 | state: FileState, |
| 2250 | toDisplay: { readonly startIndex: number; readonly endIndex: number }, |
| 2251 | currentIndex: number, |
| 2252 | length: number, |
| 2253 | figures: Effect.Success<typeof platformFigures>, |
| 2254 | renderOptions?: RenderOptions | undefined |
| 2255 | ) => { |
| 2256 | let prefix = " " |
| 2257 | if (currentIndex === toDisplay.startIndex && toDisplay.startIndex > 0) { |
| 2258 | prefix = figures.arrowUp |
| 2259 | } else if (currentIndex === toDisplay.endIndex - 1 && toDisplay.endIndex < length) { |
| 2260 | prefix = figures.arrowDown |
| 2261 | } |
| 2262 | if (state.cursor === currentIndex) { |
| 2263 | return renderOptions?.plain === true |
| 2264 | ? figures.pointer + prefix |
| 2265 | : Ansi.annotate(figures.pointer, Ansi.cyanBright) + prefix |
| 2266 | } |
| 2267 | return prefix + " " |
| 2268 | } |
| 2269 | |
| 2270 | const renderFileName = (file: string, isSelected: boolean, renderOptions?: RenderOptions | undefined) => { |
| 2271 | if (renderOptions?.plain === true) { |