MCPcopy Create free account
hub / github.com/modem-dev/hunk / resolveSplitPaneWidths

Function resolveSplitPaneWidths

src/ui/diff/codeColumns.ts:84–93  ·  view source on GitHub ↗
(width: number)

Source from the content-addressed store, hash-verified

82
83/** Split-view panes reserve one rail column on the left and one separator column in the middle. */
84export 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. */
96export function resolveSplitCellGeometry(

Callers 11

renderStaticSplitRowFunction · 0.90
resolveCopySelectionSideFunction · 0.90
renderCopySelectionTextFunction · 0.90
expandSelectionPointFunction · 0.90
pierre.test.tsFile · 0.90
measureRenderedRowHeightFunction · 0.90
renderRowFunction · 0.90
resolveCodeViewportWidthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected