summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-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);
+}