summaryrefslogtreecommitdiff
path: root/core/layout.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-25 21:40:17 -0300
committerGabriel Schneider <[email protected]>2026-11-25 23:31:32 -0300
commit0e9d91dcf8bf42ee6c9b3a777d6cac658b83f97a (patch)
tree6d82ca5200d997129aaa898314d5e89bb2bc87e0 /core/layout.zig
parent1e8787e0b2eb3eaa4991a5160f6e5c35ba6f132e (diff)
downloadpardes-0e9d91dcf8bf42ee6c9b3a777d6cac658b83f97a.tar.gz
pardes-0e9d91dcf8bf42ee6c9b3a777d6cac658b83f97a.zip
layout, Trail, Pick, look: a new pane goes into free space before it splits a pane: an untouched `+New` is taken, an empty column filled (UX DESIGN J, binding; the user: "the New panes that are empty should be taken over by the previews since doesn't make sense to keep them, this should also apply to empty colums"; p1-02: SPC f f from an empty +New made its landing pane under it and squeezed main.zig from 8 body rows to 3, p1-03: after Enter the +New kept 6 empty rows and the file got 4; at 150x45 a Look from a held main.zig split it and left an empty column empty); THE RULE: free space is an untouched pane (Trail.untouched: a +New never typed into, no undo history, its body empty, still so named, not kept, not folded, and no 9P open holding it: a look or exec open answered with it, exec.leased, or an open of one of its own files, so a script's pane/new and its `look` stay its own) or an empty column; every opening that makes a pane but New and 9P's pane/new looks for it first (layout.placeNew → freeSpace): the asking pane when it is untouched, else the nearest, in its column below it then above, then the columns to its right, nearest first, then to its left; asked from a column's tag, that column alone; an untouched pane is taken (takePane: its place, rows and weight, layout.replacePane; it closes at the step's end, Pardes.unplaced) where its rows hold the new pane's tag and two rows, as every placement leaves; a file taken into it keeps its number (@pN and its 9P state, as Trail.show's step does, the file a revision on), a terminal, kind, listing, output or Zerox twin its own (a shell's spawn and a kind's jobs went to the host by their serial as they were made; a twin's revision is its text's); a jump from an untouched pane opens its reader in its place with no owner word, its trail starting at the file (Trail.reader with no owner); a picker from one previews in it (Pick.hostIn: no pane made), Esc gives it back empty, Enter lands in it, a reading pane whose trail starts with the list word, and S-Enter and C-v there are Enter; a picker from a held pane with no reader previews in the nearest untouched pane, given back on Esc, and Enter makes it the held pane's reader by that number, or makes its landing pane in an empty column; C-v makes a column only with no free space; `Jumps new-pane`, S-Enter, C-s, a command's output, Term, +Help, +Search, a directory, the pager's +Diff go the same way; look.runSearch's 16 MB of room is the gpa's, freed, not the step's arena (core/fuzz.zig's 9P seed 610 under the new placement looked a word twice in one burst of requests, which come between steps, and asked that arena for a 75 MB node); RUN (TEST FIRST): layout.zig "free space first (UX J1)": a held pane's reader takes the +New below, above, right and left of it in that order, each by its number and in its rows, then splits as before, then takes an empty column whole; a jump from a +New, and one under Jumps new-pane, opens in it by its number; a +New typed into and emptied, kept, leased or with a file open over 9P is no free space; a command's output and a Term take a +New (shell-test); Pick.zig: a picker in a +New previews there, Esc, Enter and S-Enter; one from a held pane previews in a +New, Enter makes it the reader, C-v lands in an empty column with no column made; all four fail on the base's placement (the +New left, the landing made) and pass now; ninep/tree.zig's random placements kept every pane its tag and two rows only once a +New too short for the new pane's tag was passed by; ninep/cols.zig's column-tag command and behaviour/placement's look from a pane/new pane kept by the column-tag and 9P-open rules; two older Pick tests count panes after the step's end (the +New the Look took closes then); six tty goldens re-recorded, each the boot layout's +New taken by the pane made (nested's reader of the shell, diffstack's and pagercolor's +Diff, ttyhelp's +Help, look-fd-deep's reader, psearch's +Search, each now in the +New's rows under a shell that keeps all of its own); docs/typ/reference.typ's Placement says it; a user hit the old placement on every opening from or beside an empty +New or column; with the next change on it: core-test 1117/1290 (173 skipped; this change +4 and +1 skipped, the next +1), shell-test 1338/1341 (3 skipped; +5 and +1), pane-test 183/184, behaviour-test 280/280 and --replay 280/280 (the monkey's 20 seeds, 0 failures), process-test 0 of 147 failed (3 skipped, the six goldens moved), term-test 17/17, kitty-test 45/45, load 2.4 to 5.6; the frame and perf gate against a baseline recorded from the installed tree 1e8787e0b2eb (gpu/w2base, then gpu/walkui-W2): 76 of 77 frames byte-identical, frame 63 (a translucent addon picture over its pane) moved by this change: the veil pane takes the empty middle column whole instead of going under the third column's +New, which was typed into; the gui unit-test 1941/1945 (base 1935, no failure the base has not); perfops 121 of 121 within 0.1% (largest open on small per-op +0.0154%); perfab not measured (its pictures differ at frame 63); timedemos INFO text +2.26%, snake -1.46%, pdf +0.23% (spreads 2-3%); no dump layout change, so no fuzz or soak; load 2.9 to 4.8
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'core/layout.zig')
-rw-r--r--core/layout.zig307
1 files changed, 291 insertions, 16 deletions
diff --git a/core/layout.zig b/core/layout.zig
index 4b5b7d2c..89d206b9 100644
--- a/core/layout.zig
+++ b/core/layout.zig
@@ -11,6 +11,7 @@ const TOPBAR_H = pardes.TOPBAR_H;
const COLBAR_H = pardes.COLBAR_H;
const MAX_TAG_ROWS = pardes.MAX_TAG_ROWS;
const Pane = pardes.Pane;
+const Trail = @import("Trail.zig");
pub const Rect = struct { x: u16 = 0, y: u16 = 0, w: u16 = 0, h: u16 = 0 };
const MAX_COLS = pardes.MAX_COLS;
const MAX_PANES = pardes.MAX_PANES;
@@ -946,9 +947,9 @@ pub fn replacePane(p: *Pardes, old: usize, new: usize) void {
}
}
-/// Put new pane `id` in the layout: every new pane comes through here, as
-/// acme's makenewwindow places it, and every one but a command pane takes
-/// the keyboard. `from` is the pane that asked, `origin` the text it asked
+/// Put new pane `id` in the layout: every new pane comes through here,
+/// into free space first (freeSpace), else as acme's makenewwindow places
+/// it, and every one but a command pane takes the keyboard. `from` is the pane that asked, `origin` the text it asked
/// from: null when a column tag, the workspace tag or 9P asked (acme's
/// t->w == nil).
pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPane) void {
@@ -960,24 +961,32 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan
compute(p);
const before = v.rects;
const before_min = minima(p);
- switch (kind) {
- // New: the bottom half of the last pane in its own column
- // (look.c:921-923, et->col).
- .scratch => acmePlace(p, p.exec_column orelse columnOf(p, from), null, id),
- // +Errors, a command's output: the last column (util.c:94-98); a
- // command run from a column's tag, that column.
- .command => acmePlace(p, p.exec_column orelse v.ncol - 1, null, id),
- .errors => acmePlace(p, v.ncol - 1, null, id),
- // makenewwindow(nil) for 9P's new (acme.c:877), else (t).
- .fs => acmePlace(p, acmeColumn(p, from), null, id),
- .shell, .doc => acmePlace(p, acmeColumn(p, from), asked, id),
+ // Free space first (UX J1): an untouched pane is taken, an empty
+ // column filled, before any pane is split; an untouched pane only where
+ // its rows hold the new one's tag at that width and two rows, as every
+ // placement leaves a pane.
+ const free = if (freeSpace(p, from, kind)) |space| switch (space) {
+ .pane => |k| holds: {
+ v.rects[id].w = v.rects[k].w;
+ break :holds if (v.rects[k].h >= minRows(p, id)) space else null;
+ },
+ .column => space,
+ } else null;
+ if (free) |space| switch (space) {
+ .pane => |k| takePane(p, k, id),
+ .column => |c| acmePlace(p, c, null, id),
+ } else switch (kind) {
.reader => readerPlace(p, from, id),
+ // makenewwindow(t) asked from a pane's text.
+ .shell, .doc => acmePlace(p, columnFor(p, from, kind), asked, id),
+ .scratch, .fs, .command, .errors => acmePlace(p, columnFor(p, from, kind), null, id),
}
// No pane is made shorter than its tag and two rows: where the place
// chosen has not the room, the column's tallest pane gives it, and
// where none can, the pane is refused, and closed at the step's end
- // (Pardes.unplaced) once whatever made it is done with it.
- if (!placedRoomy(p, id, &before)) if (findPane(p, id)) |f| {
+ // (Pardes.unplaced) once whatever made it is done with it. Free space
+ // splits no pane: a pane taken gives its rows whatever they are.
+ if (free == null and !placedRoomy(p, id, &before)) if (findPane(p, id)) |f| {
removePane(p, id);
for (v.cols[f.col].panes[0..p.view().cols[f.col].n]) |k| v.rects[k] = before[k];
snapColWeights(p, f.col);
@@ -1045,6 +1054,76 @@ pub fn placeNew(p: *Pardes, from: usize, origin: ?usize, id: usize, kind: NewPan
if (findPane(p, id)) |f| p.setActiveColumn(f.col);
}
+/// The column a new pane of `kind` asked from pane `from` goes in.
+fn columnFor(p: *Pardes, from: usize, kind: NewPane) usize {
+ return switch (kind) {
+ // New: the bottom half of the last pane in its own column
+ // (look.c:921-923, et->col).
+ .scratch => p.exec_column orelse columnOf(p, from),
+ // +Errors, a command's output: the last column (util.c:94-98); a
+ // command run from a column's tag, that column.
+ .command => p.exec_column orelse p.view().ncol - 1,
+ .errors => p.view().ncol - 1,
+ // makenewwindow(nil) for 9P's new (acme.c:877), else (t).
+ .fs, .shell, .doc => acmeColumn(p, from),
+ // Its held pane's (readerPlace).
+ .reader => columnOf(p, from),
+ };
+}
+
+/// Free space (UX J1): an untouched pane (Trail.untouched) or an empty
+/// column.
+pub const Free = union(enum) { pane: usize, column: usize };
+
+/// The free space a new pane of `kind` asked from pane `from` goes into
+/// before it splits a pane (UX J1): `from` itself when it is untouched;
+/// else the nearest to where it would go, its column first (below `from`,
+/// nearest first, then above it; another column from its top), then the
+/// columns to its right, nearest first, then those to its left. Asked from
+/// a column's tag, that column alone, as acme puts the pane there; from
+/// the workspace's, no pane is the asker. None for New and 9P's pane/new,
+/// which make it.
+pub fn freeSpace(p: *Pardes, from: usize, kind: NewPane) ?Free {
+ const v = p.view();
+ if (kind == .scratch or kind == .fs or v.ncol == 0) return null;
+ const at = findPane(p, from);
+ if (at != null and !p.exec_header) if (p.panes[from]) |asker| if (Trail.untouched(p, asker)) return .{ .pane = from };
+ const c0 = columnFor(p, from, kind);
+ for (0..if (p.exec_column != null) 1 else v.ncol) |i| {
+ const c = if (c0 + i < v.ncol) c0 + i else v.ncol - 1 - i;
+ const col = v.cols[c].panes[0..v.cols[c].n];
+ if (col.len == 0) return .{ .column = c };
+ const below = if (at) |f| (if (f.col == c) f.idx + 1 else 0) else 0;
+ for (0..col.len) |j| {
+ const k = col[if (j < col.len - below) below + j else col.len - 1 - j];
+ const pane = p.panes[k] orelse continue;
+ if (Trail.untouched(p, pane)) return .{ .pane = k };
+ }
+ }
+ return null;
+}
+
+/// New pane `id` in untouched pane `k`'s place (UX J1), with its rows and
+/// weight; `k` closes at the step's end (Pardes.unplaced), once whatever
+/// made `id` is done with it. A file takes its number too, `@pN` and the
+/// 9P state its scripts hold, as a walk step's file does (Trail.show): `k`
+/// then closes never logged, and the file is a revision on from its text,
+/// so that nothing a worker was asked of it lands on this one. Any other
+/// pane keeps its own: a shell's spawn and a kind's jobs went to the host
+/// by it as the pane was made; a Zerox twin's revision is its text's.
+fn takePane(p: *Pardes, k: usize, id: usize) void {
+ const was = p.panes[k].?;
+ const now = p.panes[id].?;
+ replacePane(p, k, id);
+ p.unplaced.set(k);
+ if (!Trail.isFile(now) or now.file.?.twin != 0) return;
+ std.mem.swap(u32, &was.serial, &now.serial);
+ std.mem.swap(@TypeOf(was.fs), &was.fs, &now.fs);
+ now.file.?.revision = was.file.?.revision +% 1;
+ now.file.?.saved_revision = now.file.?.revision;
+ pardes.ctlfs.events.noteLog(p, .rename, now);
+}
+
/// acme's makenewwindow column (util.c:456-467): the column a command came
/// from (its tag's), else the active column, else the keyboard's pane's,
/// else the asking pane's.
@@ -2301,3 +2380,199 @@ test "a new pane goes below the rows a pane's text takes, a wrapped line's each
try std.testing.expect(p.view().active != a);
try std.testing.expect(p.view().rects[a].h -| pane.tag_rows >= used);
}
+
+/// UX J1's sessions: a directory of files of 100 lines, a.zig to g.zig,
+/// the session's first pane `/test.txt`, jumps walking.
+const FreeFixture = struct {
+ p: *Pardes,
+ tmp: std.testing.TmpDir,
+ dir_buf: [std.Io.Dir.max_path_bytes]u8 = undefined,
+ dir: []const u8 = "",
+
+ fn init(f: *FreeFixture, cols: u16, rows: u16) !void {
+ f.tmp = std.testing.tmpDir(.{});
+ errdefer f.tmp.cleanup();
+ var text: [100 * 9]u8 = undefined;
+ var w: std.Io.Writer = .fixed(&text);
+ for (1..101) |n| try w.print("line {d}\n", .{n});
+ for ("abcdefg") |name| try f.tmp.dir.writeFile(std.testing.io, .{ .sub_path = &.{ name, '.', 'z', 'i', 'g' }, .data = w.buffered() });
+ f.dir = f.dir_buf[0..try f.tmp.dir.realPath(std.testing.io, &f.dir_buf)];
+ f.p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = cols, .rows = rows });
+ errdefer f.p.deinit();
+ _ = try f.p.setTestFile("first\n");
+ f.p.settings.jumps = .walk;
+ }
+
+ fn deinit(f: *FreeFixture) void {
+ f.p.deinit();
+ f.tmp.cleanup();
+ }
+
+ /// A pane made at `idx` of column `c` and laid there by hand: a +New
+ /// (`held` false), or a held file of the directory's.
+ fn paneAt(f: *FreeFixture, c: usize, idx: usize, held: bool) !usize {
+ const p = f.p;
+ const id = p.freeSlot().?;
+ if (held) {
+ const pane = try p.newDocPane(id);
+ pane.file = .{ .path = try std.Io.Dir.path.join(p.gpa, &.{ f.dir, "held.txt" }), .content = try p.gpa.dupe(u8, "held\n"), .history = try panes.File.History.create(p.gpa) };
+ Trail.keep(pane);
+ } else _ = try panes.newScratch(p, 0, id, .scratch);
+ insert(p, c, idx, id);
+ p.sync();
+ return id;
+ }
+
+ /// A Look from pane `id` at `name`.zig:`line`; the pane it landed in.
+ fn look(f: *FreeFixture, id: usize, name: u8, line: usize) usize {
+ var buf: [std.Io.Dir.max_path_bytes + 16]u8 = undefined;
+ pardes.look.lookAt(f.p, id, std.fmt.bufPrint(&buf, "{s}/{c}.zig:{d}", .{ f.dir, name, line }) catch unreachable);
+ f.p.sync();
+ return f.p.view().active;
+ }
+
+ fn count(f: *const FreeFixture) usize {
+ var n: usize = 0;
+ for (f.p.panes) |slot| n += @intFromBool(slot != null);
+ return n;
+ }
+};
+
+test "free space first (UX J1): a held pane's reader takes the untouched +New nearest it, in its column below then above, then the columns to its right, then to its left, each keeping its number and rows; with none it splits a pane as before; an empty column is taken whole before a split" {
+ var f: FreeFixture = .{ .p = undefined, .tmp = undefined };
+ try f.init(150, 45);
+ defer f.deinit();
+ const p = f.p;
+ _ = insertColumn(p, 0, false).?;
+ _ = insertColumn(p, 1, false).?;
+ // Column 0: the first pane, a +New; column 1: a +New, the held pane,
+ // a +New; column 2: a +New.
+ const left = try f.paneAt(0, 1, false);
+ const above = try f.paneAt(1, 0, false);
+ const held = try f.paneAt(1, 1, true);
+ const below = try f.paneAt(1, 2, false);
+ const right = try f.paneAt(2, 0, false);
+ const n = f.count();
+ for ([_]usize{ below, above, right, left }, 0..) |want, i| {
+ const serial = p.panes[want].?.serial;
+ const rect = p.view().rects[want];
+ const reader = f.look(held, "abcd"[i], 10);
+ // In its place, its number, its rows; the +New gone.
+ try std.testing.expect(p.panes[want] == null);
+ try std.testing.expectEqual(serial, p.panes[reader].?.serial);
+ try std.testing.expectEqual(rect.y, p.view().rects[reader].y);
+ try std.testing.expectEqual(rect.x, p.view().rects[reader].x);
+ try std.testing.expectEqual(n, f.count());
+ try std.testing.expectEqual(p.panes[held].?.serial, p.panes[reader].?.trail.steps[0].owner);
+ try std.testing.expectEqual("abcd"[i], std.Io.Dir.path.basename(p.panes[reader].?.file.?.path)[0]);
+ // Kept: the next jump makes a new reader.
+ Trail.keep(p.panes[reader].?);
+ }
+ // No free space: placed as before (readerPlace), the held pane too
+ // short to halve: at the bottom of the next column, splitting it.
+ const split = f.look(held, 'e', 20);
+ try std.testing.expectEqual(n + 1, f.count());
+ try std.testing.expectEqual(@as(usize, 2), findPane(p, split).?.col);
+ try std.testing.expectEqual(@as(usize, 2), p.view().cols[2].n);
+ // An empty column, right of them all: the next reader takes it whole,
+ // the held pane keeping its rows.
+ Trail.keep(p.panes[split].?);
+ const c = insertColumn(p, 2, false).?;
+ p.sync();
+ const kept = p.view().rects[held];
+ const whole = f.look(held, 'f', 30);
+ try std.testing.expectEqual(c, findPane(p, whole).?.col);
+ try std.testing.expectEqual(@as(usize, 1), p.view().cols[c].n);
+ try std.testing.expectEqual(kept, p.view().rects[held]);
+}
+
+test "free space first (UX J1): a jump from an untouched +New reads in it, the same pane by its number, its trail starting at the file; under Jumps new-pane it opens in it the same way; a +New typed into and emptied, kept, or held by a 9P open (answered with it, or one of its files open) is never free space" {
+ var f: FreeFixture = .{ .p = undefined, .tmp = undefined };
+ try f.init(120, 40);
+ defer f.deinit();
+ const p = f.p;
+ // Walking: the +New is the file now, as a reading pane's step makes it.
+ const scratch = try f.paneAt(0, 1, false);
+ const serial = p.panes[scratch].?.serial;
+ const n = f.count();
+ const into = f.look(scratch, 'a', 12);
+ try std.testing.expectEqual(serial, p.panes[into].?.serial);
+ try std.testing.expectEqual(n, f.count());
+ try std.testing.expect(Trail.reading(p, p.panes[into].?));
+ try std.testing.expectEqual(@as(u8, 1), p.panes[into].?.trail.n);
+ try std.testing.expectEqual(@as(u32, 12), p.panes[into].?.trail.steps[0].place.line);
+ // Under Jumps new-pane: the same, placement not a walk.
+ p.settings.jumps = .@"new-pane";
+ const other = try f.paneAt(0, 2, false);
+ const other_serial = p.panes[other].?.serial;
+ pardes.exec.runBuiltin(p, .Keep, into, "Keep", null);
+ const opened = f.look(other, 'b', 3);
+ try std.testing.expectEqual(other_serial, p.panes[opened].?.serial);
+ try std.testing.expectEqual(n + 1, f.count());
+ try std.testing.expectEqualStrings("b.zig", std.Io.Dir.path.basename(p.panes[opened].?.file.?.path));
+ p.settings.jumps = .walk;
+ // Never free space: typed into and emptied again, kept, leased.
+ const typed = try f.paneAt(0, 3, false);
+ p.view().active = typed;
+ for ("ix") |ch| p.update(.{ .key = .{ .cp = ch, .text = &[_]u8{ch} } });
+ p.update(.{ .key = .{ .cp = pardes.Key.escape } });
+ p.update(.{ .key = .{ .cp = 'u', .text = "u" } });
+ try std.testing.expectEqual(@as(usize, 0), p.panes[typed].?.file.?.content.len);
+ const kept = try f.paneAt(0, 4, false);
+ Trail.keep(p.panes[kept].?);
+ const leased = try f.paneAt(0, 5, false);
+ p.fs.opens[0] = .{ .node = 1 };
+ p.fs.opens[0].results.list[0] = p.panes[leased].?.serial;
+ p.fs.opens[0].results.len = 1;
+ p.fs.opens[0].results.wrote = true;
+ // ...and one whose own file a 9P client holds open (a script's look
+ // at it): a script's pane/new stays its own.
+ const held_open = try f.paneAt(0, 6, false);
+ p.fs.opens[1] = .{ .node = pardes.ctlfs.Node.of(p.panes[held_open].?.serial, .look) };
+ p.fs.opens_len = 2;
+ defer p.fs.opens[0] = .{};
+ defer p.fs.opens[1] = .{};
+ for ([_]usize{ typed, kept, leased, held_open }) |k| try std.testing.expect(!Trail.untouched(p, p.panes[k].?));
+ try std.testing.expect(freeSpace(p, 0, .doc) == null);
+ try std.testing.expect(freeSpace(p, 0, .reader) == null);
+}
+
+test "free space first (UX J1): a command's output and a Term take an untouched +New's place, the asking one first, each by a number of its own; New and 9P's pane/new never do" {
+ if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane's terminal
+ var f: FreeFixture = .{ .p = undefined, .tmp = undefined };
+ try f.init(120, 40);
+ defer f.deinit();
+ const p = f.p;
+ _ = insertColumn(p, 0, false).?;
+ // A +New in the last column, where a command's output goes.
+ const last = try f.paneAt(1, 0, false);
+ const rect = p.view().rects[last];
+ const out = pardes.exec.runCommand(p, 0, "true").?;
+ p.sync();
+ try std.testing.expect(p.panes[last] == null);
+ try std.testing.expect(p.panes[out].?.command != null);
+ try std.testing.expectEqual(rect, p.view().rects[out]);
+ // A Term run from an untouched +New is in its place.
+ const asker = try f.paneAt(0, 1, false);
+ const at = p.view().rects[asker];
+ const n = f.count();
+ pardes.exec.runBuiltin(p, .Term, asker, "Term", null);
+ p.sync();
+ try std.testing.expectEqual(n, f.count());
+ try std.testing.expect(p.panes[asker] == null);
+ try std.testing.expect(p.panes[p.view().active].?.isTerminal());
+ try std.testing.expectEqual(at, p.view().rects[p.view().active]);
+ // New makes free space, and 9P's pane/new: neither takes it.
+ const before = f.count();
+ pardes.exec.runBuiltin(p, .New, 0, "New", null);
+ p.sync();
+ const scratch = p.view().active;
+ try std.testing.expect(Trail.untouched(p, p.panes[scratch].?));
+ pardes.exec.runBuiltin(p, .New, scratch, "New", null);
+ p.sync();
+ try std.testing.expectEqual(before + 2, f.count());
+ panes.newScratchFor(p, scratch, .fs);
+ p.sync();
+ try std.testing.expectEqual(before + 3, f.count());
+ try std.testing.expect(p.panes[scratch] != null);
+}