From 672b2643583d13feef5d47600e0f6c15f276fba2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 02:32:33 -0300 Subject: No placement leaves a pane shorter than its tag and two rows Placement could split a pane down to a tag and one row, or give a new one less. Every placement now checks the pane it made and each pane it shrank against its tag (wrapped at its width) plus two rows: where they lack the room, the column's tallest pane is halved instead, and where none can give it the new pane is refused with "no space for a pane in that column" (ENOSPC over 9P) and closed at the step's end, once its maker is done with it. splitBelow and splitParent leave two body rows (a boot layout, split before any row exists, is as before). Re-recorded by name: lookpanes (panes one or two rows lower) and splitparent (the 6-row squeeze now refuses); fs.py closes the scratches and long-named panes it no longer needs, since its 24-row session filled. Co-Authored-By: Claude Opus 5.5 --- src/Messages.zig | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/Messages.zig') diff --git a/src/Messages.zig b/src/Messages.zig index b197e715..daf195bb 100644 --- a/src/Messages.zig +++ b/src/Messages.zig @@ -444,18 +444,23 @@ pub fn messageLog(m: *const Messages, i: usize) ?*const LoggedMessage { return &m.log[(first + i) % limits.message_log]; } -/// `: `: FileNotFound reads "file not found". /// What a route that would open a pane says when every slot is taken. /// "no space": 9ns's word for ENOSPC (it has none for ENFILE). pub const no_pane_slots = "no space for a pane: {d} max"; +/// ...and when the column it would go in has no rows for one. +pub const no_pane_room = "no space for a pane in that column: each keeps its tag and {d} rows"; +/// `: `: FileNotFound reads "file not found". pub fn reportError(p: *Pardes, id: usize, operation: []const u8, err: anyerror) void { var buf: [256]u8 = undefined; var w = std.Io.Writer.fixed(&buf); w.print("{s}: ", .{operation}) catch {}; // Every route that opens a pane says the cap the same way. - if (err == error.NoPaneSlots) { - w.print(no_pane_slots, .{pardes.MAX_PANES}) catch {}; + if (err == error.NoPaneSlots or err == error.NoPaneRoom) { + if (err == error.NoPaneSlots) + w.print(no_pane_slots, .{pardes.MAX_PANES}) catch {} + else + w.print(no_pane_room, .{pardes.layout.min_body_rows}) catch {}; // A 9P look or exec that would open the pane fails with it too. p.fs.no_pane_slot = true; @memcpy(p.fs.ename[0..w.buffered().len], w.buffered()); -- cgit v1.3