Build wrapped split-cell gutter/content lines while keeping continuation gutters blank.
( cell: SplitLineCell, width: number, lineNumberDigits: number, showLineNumbers: boolean, prefixWidth: number, theme: AppTheme, )
| 360 | |
| 361 | /** Build wrapped split-cell gutter/content lines while keeping continuation gutters blank. */ |
| 362 | function buildWrappedSplitCell( |
| 363 | cell: SplitLineCell, |
| 364 | width: number, |
| 365 | lineNumberDigits: number, |
| 366 | showLineNumbers: boolean, |
| 367 | prefixWidth: number, |
| 368 | theme: AppTheme, |
| 369 | ) { |
| 370 | const palette = splitCellPalette(cell.kind, theme); |
| 371 | const { gutterWidth, contentWidth } = resolveSplitCellGeometry( |
| 372 | width, |
| 373 | lineNumberDigits, |
| 374 | showLineNumbers, |
| 375 | prefixWidth, |
| 376 | ); |
| 377 | const firstGutterText = splitGutterText(cell, lineNumberDigits, showLineNumbers).padEnd( |
| 378 | gutterWidth, |
| 379 | ); |
| 380 | const wrappedSpans = wrapSpans(cell.spans, contentWidth); |
| 381 | |
| 382 | return { |
| 383 | gutterWidth, |
| 384 | contentWidth, |
| 385 | palette, |
| 386 | lines: wrappedSpans.map((spans, index) => ({ |
| 387 | gutterText: index === 0 ? firstGutterText : " ".repeat(gutterWidth), |
| 388 | spans, |
| 389 | })), |
| 390 | } satisfies WrappedCellLayout; |
| 391 | } |
| 392 | |
| 393 | /** Build wrapped stack-cell gutter/content lines while keeping continuation gutters blank. */ |
| 394 | function buildWrappedStackCell( |
no test coverage detected