From bdc7084e2a1480272eda770a4e20bb9783c860d3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 24 Nov 2026 19:35:47 -0300 Subject: 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) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- core/Trail.zig | 28 ++++++++++++++++++++++++++++ docs/typ/builtins-gui.json | 2 ++ test/snapshots/builtins.golden | 4 ++-- 3 files changed, 32 insertions(+), 2 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); +} diff --git a/docs/typ/builtins-gui.json b/docs/typ/builtins-gui.json index 8ec78384..df2ede27 100644 --- a/docs/typ/builtins-gui.json +++ b/docs/typ/builtins-gui.json @@ -57,6 +57,8 @@ {"name": "Joincol", "leader": "SPC c j", "also": ["topbar"], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "Fold the keyboard's column into the one on its right, keeping its panes.", "text": "Fold the keyboard's column into the one on its right, keeping its panes.\nRefused for the last column, and where the joined column could not give each pane its tag and 2 rows."}, {"name": "JumpTrail", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "on, off", "doc": "A jump of the cursor leaves a short trail that fades, on or off.", "text": "A jump of the cursor leaves a short trail that fades, on or off."}, {"name": "Jumplist", "leader": "SPC j l", "also": [], "arg": false, "scope": "root", "setting": false, "choices": null, "doc": "List the places jumped from in a +Jumps, each a place to go.", "text": "List the places jumped from in a +Jumps, each a place to go."}, + {"name": "Jumps", "leader": null, "also": [], "arg": true, "scope": "root", "setting": true, "choices": "walk, new-pane", "doc": "A jump steps its pane or that pane's reader (walk), or opens a pane for each file (new-pane).", "text": "A jump steps its pane or that pane's reader (walk), or opens a pane for each file (new-pane)."}, + {"name": "Keep", "leader": "SPC j k", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Keep this pane: a reading pane, which a jump steps, is held from now on.", "text": "Keep this pane: a reading pane, which a jump steps, is held from now on.\nIts walk leaves its tag (its places, its owner): the next jump from its owner makes a new reader. Editing a reading pane keeps it too."}, {"name": "Kill", "leader": null, "also": [], "arg": true, "scope": "root", "setting": false, "choices": null, "doc": "Stop the commands pardes started that are still running.", "text": "Stop the commands pardes started that are still running.\nThey are the lines pardes typed into a terminal (from an exec, a middle click, a pty/run) and its command panes. Bare, every one; `Kill make ls`, those whose line starts with one of the words. Each gets SIGTERM: a command pane's whole command, a terminal's foreground job, never its shell, which stays."}, {"name": "Last", "leader": "SPC j j", "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Go back to the last place jumped from in another pane.", "text": "Go back to the last place jumped from in another pane.\nWith none, to the pane beside this one."}, {"name": "Left", "leader": null, "also": [], "arg": false, "scope": "pane", "setting": false, "choices": null, "doc": "Move the keyboard to the pane, or column tag, to the left.", "text": "Move the keyboard to the pane, or column tag, to the left."}, diff --git a/test/snapshots/builtins.golden b/test/snapshots/builtins.golden index e9786c8a..516bbf56 100644 --- a/test/snapshots/builtins.golden +++ b/test/snapshots/builtins.golden @@ -34,7 +34,7 @@ |30: ~ |57: +Search 1/1 Save Undock Del |58: /^ +Look -|59: @p2:220:1 Look enter, right-click +|59: @p2:224:1 Look enter, right-click == snap docs-group grid=120x67 cursor=7,10 |10: 1 pardes builtins under SPC h |12: 3 SPC h b Build @@ -59,7 +59,7 @@ |10: 1 pardes builtins under SPC h Tutor |26: +Search 1/1 Save Undock Del |27: /^ +Look -|28: @p2:220:1 Look enter, right-click +|28: @p2:224:1 Look enter, right-click |36: /tmp/pardes-snap/builtins/cwd/+Tutor Save Term Collapse Follow Del |37: 1 |38: 2 PARDES TUTOR -- cgit v1.3