diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 18:04:25 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:17 -0300 |
| commit | f65cb652243bf0a63eecdd4d6c5cd8ccbc3fd2ea (patch) | |
| tree | 28f31651e214eaf4177209122e263fefaf186328 /src/exec.zig | |
| parent | b608fc54c40ff3dff6057569bd65d3f729c6d4f9 (diff) | |
| download | pardes-f65cb652243bf0a63eecdd4d6c5cd8ccbc3fd2ea.tar.gz pardes-f65cb652243bf0a63eecdd4d6c5cd8ccbc3fd2ea.zip | |
Under pardes's placement a pane whose neighbour is in no column goes at a column's foot, not nowhere
After Delcol took the last column's panes, pane/new under Placement made a scratch that no column held, since a scratch was placed only under the asking pane, which was gone; a look from it then unwrapped the missing parent in belowParent and panicked (the 9P monkey's crash-e1873f34). Both now fall back to the foot of the active column, else the last.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
| -rw-r--r-- | src/exec.zig | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig index 87f6da40..2c42389c 100644 --- a/src/exec.zig +++ b/src/exec.zig @@ -1150,7 +1150,7 @@ fn pardesPlace(p: *Pardes, from: usize, id: usize, kind: NewPane) void { .scratch, .fs => if (layout.findPane(p, from)) |sf| { layout.insert(p, sf.col, sf.idx + 1, id); layout.splitBelow(p, from, nt); - }, + } else atFoot(p, id), .shell => belowParent(p, from, id), .doc, .errors => pardesDoc(p, from, id), .command => { @@ -1160,9 +1160,18 @@ fn pardesPlace(p: *Pardes, from: usize, id: usize, kind: NewPane) void { } } +/// Where a pane goes when the one it would go under is in no column (Delcol +/// took them all, or it was never placed): the foot of the active column, +/// else of the last. +fn atFoot(p: *Pardes, id: usize) void { + const c = p.activeColumn() orelse p.ncol - 1; + layout.insert(p, c, p.col_n[c], id); + if (p.col_n[c] == 1) p.panes[id].?.vweight = 1; +} + fn belowParent(p: *Pardes, from: usize, id: usize) void { const parent = layout.splitParent(p, from); - const f = layout.findPane(p, parent).?; + const f = layout.findPane(p, parent) orelse return atFoot(p, id); layout.insert(p, f.col, f.idx + 1, id); layout.splitBelow(p, parent, p.panes[id].?); } |
