summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/Trail.zig28
-rw-r--r--docs/typ/builtins-gui.json2
-rw-r--r--test/snapshots/builtins.golden4
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