summaryrefslogtreecommitdiff
path: root/core/Trail.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-24 19:35:47 -0300
committerGabriel Schneider <[email protected]>2026-11-24 20:32:47 -0300
commitbdc7084e2a1480272eda770a4e20bb9783c860d3 (patch)
tree1e7f1b1819d3374bf3969019e4690bda14089fb6 /core/Trail.zig
parent9f63733156853c925c31a948b50d4a3a7b77aa70 (diff)
downloadpardes-bdc7084e2a1480272eda770a4e20bb9783c860d3.tar.gz
pardes-bdc7084e2a1480272eda770a4e20bb9783c860d3.zip
walk (pick-ui SPEC §6.6, item 6 of the Walk UI line B): `Jumps new-pane`, the default (item 1 made the setting: a Settings choice, `Jumps walk` in a tag or an init line, reported by DumpConfig), jumps exactly as before the walk: look.open runs the new-pane code it always ran, nothing reads (no Keep, no tint) and no trail is made; TEST FIRST: Trail.zig "Jumps new-pane jumps as before the walk: a new pane for a file no pane shows, under the asking one, the one showing it focused, nothing stepped"; docs/typ/builtins-gui.json refreshed for Keep and Jumps, and the builtins process golden (its Look row 4 lines down); on the stack: shell-test 1214/1217, term-test 17/17, kitty-test 45/45, behaviour-test --replay 277/277, process-test 146 less the builtins golden refreshed here, the soak (5 clients) diverged 0 unequal 0 quiet checks 595/0 corpus 22/22, the gate against tree7: unit-test 1809/1813 (no failure the base has not), frame 76 and the 8 deep-sel counts differ as main's own gate merge70-g does (load 5-9)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'core/Trail.zig')
-rw-r--r--core/Trail.zig28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/Trail.zig b/core/Trail.zig
index 7166d810..69f149df 100644
--- a/core/Trail.zig
+++ b/core/Trail.zig
@@ -660,3 +660,31 @@ test "closing a held pane closes its reader; a kept reader stays; typed into, a
try std.testing.expect(p.paneBySerial(fresh_serial) == null);
try std.testing.expect(p.panes[r] != null);
}
+
+test "Jumps new-pane jumps as before the walk: a new pane for a file no pane shows, under the asking one, the one showing it focused, nothing stepped" {
+ var f: Fixture = .{ .p = undefined, .tmp = undefined };
+ try f.init(60);
+ defer f.deinit();
+ const p = f.p;
+ p.settings.jumps = .@"new-pane";
+ var at: [64]u8 = undefined;
+ var open: usize = 0;
+ for (p.panes) |slot| open += @intFromBool(slot != null);
+ // From the held pane and from the reading one: a new pane each time.
+ f.look(f.held, "rank.zig", 12);
+ const rank = p.view().active;
+ try std.testing.expectEqualStrings("rank.zig:12", f.at(&at));
+ f.look(rank, "place.zig", 8);
+ try std.testing.expect(p.view().active != rank and p.panes[rank] != null);
+ try std.testing.expectEqualStrings("place.zig:8", f.at(&at));
+ // A file a pane shows: that pane, focused; nothing new, no walk.
+ f.look(p.view().active, "rank.zig", 30);
+ try std.testing.expectEqual(rank, p.view().active);
+ try std.testing.expectEqualStrings("rank.zig:30", f.at(&at));
+ var now: usize = 0;
+ for (p.panes) |slot| if (slot) |pane| {
+ now += 1;
+ try std.testing.expectEqual(@as(u8, 0), pane.trail.n);
+ };
+ try std.testing.expectEqual(open + 2, now);
+}