From 84d23aef86c0bcb6ee14bb69b1e4d6d65205e2f6 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 03:39:43 -0300 Subject: size says its limits, keeps every pane its rows, and ptys follow their panes size refused an out-of-range line without saying the range, took a size too small for the panes (leaving bodies of no rows), and a terminal squeezed to its tag kept a pty of its old size. The refusal now names 20x6 to 4096x4096 (a bare size is EINVAL like any malformed line), a size that would leave any pane less than its tag and 2 rows is refused and undone, and a terminal's pty is resized with its pane down to one row (only a folded or unplaced one keeps its grid). Co-Authored-By: Claude Opus 5.5 --- src/layout.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/layout.zig') diff --git a/src/layout.zig b/src/layout.zig index 4c974fb7..bdef9675 100644 --- a/src/layout.zig +++ b/src/layout.zig @@ -433,6 +433,20 @@ pub fn placedRoomy(p: *Pardes, id: usize, before: *const [MAX_PANES]Rect) bool { return true; } +/// Whether every unfolded pane sharing its column has its tag and +/// `min_body_rows` (one alone in its column always fits). +pub fn everyPaneRoomy(p: *Pardes) bool { + compute(p); + for (0..p.ncol) |c| { + if (p.col_n[c] < 2) continue; + for (p.col_panes[c][0..p.col_n[c]]) |k| { + const pane = p.panes[k] orelse continue; + if (!pane.collapsed and p.rects[k].h < minRows(p, k)) return false; + } + } + return true; +} + /// Places `id` in column `c` by halving its tallest unfolded pane, when /// that leaves both their rows; false, and `id` in no column, when not. pub fn splitTallest(p: *Pardes, c: usize, id: usize) bool { -- cgit v1.3