diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 14:17:56 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | 69c5e62fe45a3768edff14993789f2aadfafadec (patch) | |
| tree | fc622dc533fafb7deeb04c5d9e88d65a3a6a2c9a /src/exec.zig | |
| parent | 70ea4cb543df4724a977d7e8c10f2b5f470df94f (diff) | |
| download | pardes-69c5e62fe45a3768edff14993789f2aadfafadec.tar.gz pardes-69c5e62fe45a3768edff14993789f2aadfafadec.zip | |
pane/new takes rows from a pane in another column before refusing ENOSPC, as acme's placement does
A pane/new whose column had no room was refused "no space for a pane in
that column", even with another column holding a tall pane that could
give rows. acme takes rows wherever a window has them before saying
there are none. pane/new now tries the other columns as +Errors already
did: an empty one, else its tallest pane's bottom half, last column
first. It is refused only when no pane anywhere can give the rows.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/exec.zig b/src/exec.zig index 8356db75..7d682d74 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -1045,9 +1045,12 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan // 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 (layout.shareColumn(p, f.col)) {} else if (kind == .errors) { + // +Errors and 9P's pane/new go wherever there is room, last + // column first, as acme takes rows from a window that has them + // before saying there are none; with none, +Errors's maker says + // the text some other way (appendErrors), and pane/new is + // refused. + if (layout.shareColumn(p, f.col)) {} else if (kind == .errors or kind == .fs) { layout.removePane(p, id); var c = p.ncol; while (c > 0) { @@ -1064,6 +1067,11 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan } else { layout.insert(p, f.col, p.col_n[f.col], id); p.unplaced.set(id); + // No pane anywhere can give it rows: pane/new is refused. + if (kind == .fs) { + p.panes[id].?.vweight = 0; + p.reportError(from, "placement", error.NoPaneRoom); + } return; } } else { |
