( cell: SplitLineCell, side: "left" | "right", width: number, theme: AppTheme, lineNumberWidth: number, options: CommonOptions, )
| 161 | } |
| 162 | |
| 163 | function renderStaticSplitCell( |
| 164 | cell: SplitLineCell, |
| 165 | side: "left" | "right", |
| 166 | width: number, |
| 167 | theme: AppTheme, |
| 168 | lineNumberWidth: number, |
| 169 | options: CommonOptions, |
| 170 | ) { |
| 171 | const palette = splitCellPalette(cell.kind, theme, cell.moveKind); |
| 172 | const { gutterWidth, contentWidth } = resolveSplitCellGeometry( |
| 173 | width, |
| 174 | lineNumberWidth, |
| 175 | options.lineNumbers !== false, |
| 176 | marker().length, |
| 177 | ); |
| 178 | const railColor = |
| 179 | side === "left" |
| 180 | ? splitLeftRailColor(cell.kind, theme, true) |
| 181 | : splitRightRailColor(cell.kind, theme, true); |
| 182 | const gutterText = fixedWidthText( |
| 183 | staticSplitGutterText(cell, lineNumberWidth, options.lineNumbers !== false), |
| 184 | gutterWidth, |
| 185 | ); |
| 186 | |
| 187 | return `${colorText(marker(), railColor, theme.panel)}${colorText( |
| 188 | gutterText, |
| 189 | palette.numberColor, |
| 190 | palette.gutterBg, |
| 191 | )}${serializeSpansFixedWidth(cell.spans, palette.contentBg, contentWidth)}`; |
| 192 | } |
| 193 | |
| 194 | /** Render one non-interactive split diff row as ANSI text. */ |
| 195 | function renderStaticSplitRow( |
no test coverage detected