( width: number, lineNumberDigits: number, showLineNumbers: boolean, prefixWidth = DIFF_RAIL_PREFIX_WIDTH, )
| 94 | |
| 95 | /** Resolve the split-cell gutter and code viewport after the rail prefix. */ |
| 96 | export function resolveSplitCellGeometry( |
| 97 | width: number, |
| 98 | lineNumberDigits: number, |
| 99 | showLineNumbers: boolean, |
| 100 | prefixWidth = DIFF_RAIL_PREFIX_WIDTH, |
| 101 | ) { |
| 102 | const availableWidth = Math.max(0, width - prefixWidth); |
| 103 | const gutterWidth = Math.min(availableWidth, showLineNumbers ? lineNumberDigits + 3 : 2); |
| 104 | |
| 105 | return { |
| 106 | gutterWidth, |
| 107 | contentWidth: Math.max(0, availableWidth - gutterWidth), |
| 108 | }; |
| 109 | } |
| 110 | |
| 111 | /** Resolve the stack-cell gutter and code viewport after the left rail prefix. */ |
| 112 | export function resolveStackCellGeometry( |
no outgoing calls
no test coverage detected