szn

Bug 250 — Inverted dimension assignment in swapPaneRelative

250. Inverted dimension assignment in swapPaneRelative

File: src/server/server.zig:1236–1260 Severity: HIGH Status: ✅ FIXED — swapped node parameters to resizePaneToNode(pane, node2, ...) and resizePaneToNode(dest_pane, node1, ...) so each pane receives its correct new slot dimensions. Updated unit tests.

Bug #220 added resizePaneToNode calls to update terminal sizes after swapping pane slots:

node1.leaf = dest_pane;
node2.leaf = pane;
// ...
resizePaneToNode(pane, node1, &window.layout);
resizePaneToNode(dest_pane, node2, &window.layout);

Since node1.leaf was already updated to dest_pane and node2.leaf to pane, calling resizePaneToNode(pane, node1) looks up node1 (which is dest_pane’s slot) and resizes pane to dest_pane’s dimensions. When swapping two panes of unequal sizes, each pane is resized to the other pane’s target slot, causing both swapped panes to render with mismatched layout bounds.

Fix: Swap the node arguments in the calls: resizePaneToNode(pane, node2, ...) and resizePaneToNode(dest_pane, node1, ...).