szn

Bug 535 — duplicate Window.removePane / Window.extractPane

535. Duplicated pane-removal logic

Severity: LOW (code quality) Status: ✅ FIXED Files: src/window.zig:447-496

Problem

removePane and extractPane share the same lookup, swap-remove, layout update and resize steps; only the active-pane selection differs. The layout-level pair was already collapsed under bug #520, but the Window-level pair remains.

Proposed Fix

Fold both into one function taking a flag (or an enum) for whether the pane is being destroyed versus extracted, so the shared body exists once.

Fix

All extractPane call sites in src/cmd/cmd.zig now call removePane directly, and the duplicate Window.extractPane method was removed. The two were behaviourally identical (both swap-remove, update the layout, and resize), so no semantics changed.

Verification status

Fixed and verified with zig build / zig build test on Zig 0.16.0 and zig build on 0.17.0.