Do not count siblings of a hidden pane that is the root of the layout.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Michael Grant
2026-10-01 20:58:32 +01:00
parent 0ce3f20a2d
commit 6b64ff92e6
2 changed files with 23 additions and 0 deletions

View File

@@ -279,6 +279,27 @@ run rotate-window -Z
check "$A" '#{pane_hidden_flag}' 0
check "$B" '#{pane_hidden_flag}' 0
# Hiding every pane, then showing and closing them one by one, leaves the last
# pane hidden as the only pane in the window; showing it must not crash.
reset
C=$(run split-window -dPF '#{pane_id}') || exit 1
for p in "$A" "$B" "$C"; do
run resize-pane -H -t "$p"
done
for p in "$A" "$B"; do
run select-pane -t "$p"
hidden "$p" 0
run kill-pane -t "$p"
done
hidden "$C" 1
check "$C" '#{window_panes}' 1
run select-pane -t "$C"
hidden "$C" 0
check "$C" '#{pane_active}:#{pane_width}x#{pane_height}' '1:80x24'
run resize-pane -H -t "$C"
run resize-pane -H -t "$C"
hidden "$C" 0
# Floating and tiling a hidden pane keeps it hidden.
reset
run resize-pane -H -t "$B"

View File

@@ -1027,6 +1027,8 @@ window_count_tiled_siblings(struct layout_cell *lc)
struct layout_cell *lcsib;
u_int n = 0;
if (lc->parent == NULL)
return (0);
TAILQ_FOREACH(lcsib, &lc->parent->cells, entry) {
if (lcsib == lc)
continue;