summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-30 17:24:55 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit41147087343144a439a77e6b9817f30d596a6fcb (patch)
tree35016c5a3b69464ebd95964da6bc9af71adb3262 /src/pardes.zig
parente626219c9e35b37dece1348f1349c40866871f4c (diff)
downloadpardes-41147087343144a439a77e6b9817f30d596a6fcb.tar.gz
pardes-41147087343144a439a77e6b9817f30d596a6fcb.zip
A pane refused for want of room spends no pane serial, as a refused Newcol spends no column serial
A pane/new, look or exec refused ENOSPC made its pane before placing it. The refusal closed the pane unannounced, but its serial was gone, so the next pane skipped one. When sync removes a refused pane that holds the newest serial, it now puts the counter back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 3a6e154a..dc2ec59f 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -6995,7 +6995,13 @@ pub const Pardes = struct {
var refused = false;
while (p.unplaced.findFirstSet()) |id| {
p.unplaced.unset(id);
- if (p.panes[id] != null) p.removePane(id, null) catch {};
+ if (p.panes[id]) |pane| {
+ // Refused, it was never there: the serial it took is the
+ // next pane's, as a refused Newcol's column serial is.
+ const newest = pane.serial == p.next_serial;
+ p.removePane(id, null) catch {};
+ if (newest and p.panes[id] == null) p.next_serial -= 1;
+ }
refused = true;
}
// A refused pane gone, no pane it squeezed stays under its minimum.