(width: number)
| 82 | |
| 83 | /** Split-view panes reserve one rail column on the left and one separator column in the middle. */ |
| 84 | export function resolveSplitPaneWidths(width: number) { |
| 85 | const usableWidth = Math.max(0, width - DIFF_RAIL_PREFIX_WIDTH - DIFF_SPLIT_SEPARATOR_WIDTH); |
| 86 | const leftWidth = Math.max(0, DIFF_RAIL_PREFIX_WIDTH + Math.floor(usableWidth / 2)); |
| 87 | const rightWidth = Math.max( |
| 88 | 0, |
| 89 | DIFF_SPLIT_SEPARATOR_WIDTH + usableWidth - Math.floor(usableWidth / 2), |
| 90 | ); |
| 91 | |
| 92 | return { leftWidth, rightWidth }; |
| 93 | } |
| 94 | |
| 95 | /** Resolve the split-cell gutter and code viewport after the rail prefix. */ |
| 96 | export function resolveSplitCellGeometry( |
no outgoing calls
no test coverage detected