diff options
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/exec.zig b/src/exec.zig index 79717963..60c4172d 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -977,9 +977,12 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan layout.snapColWeights(p, f.col); if (!layout.splitTallest(p, f.col, id) or !layout.placedRoomy(p, id, &before)) { if (layout.findPane(p, id) == null) layout.insert(p, f.col, p.col_n[f.col], id); + // No pane to halve, but the column holds every pane's minimum + // with the new one's: the rows are shared out again, so what is + // refused is only what the documented arithmetic cannot hold. // +Errors goes wherever there is room, last column first; with // none, its maker says the text some other way (appendErrors). - if (kind == .errors) { + if (layout.shareColumn(p, f.col)) {} else if (kind == .errors) { layout.removePane(p, id); var c = p.ncol; while (c > 0) { @@ -999,12 +1002,20 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan return; } } else { + // Refused, it closes at the step's end holding no weight, so + // its column's rows come back as they were, none rounded off. + p.panes[id].?.vweight = 0; p.unplaced.set(id); p.reportError(from, "placement", error.NoPaneRoom); return; } } }; + // Placed: no pane of its column left under its minimum by the rows + // rounding or an earlier placement gave it; shared out again if so. + if (layout.findPane(p, id)) |f| if (!layout.columnAtMinimums(p, f.col)) { + _ = layout.shareColumn(p, f.col); + }; if (kind == .command) return; tagline.exitHeader(p); p.active = id; |
