summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 5fdcfe3c..d9c69921 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -6705,9 +6705,14 @@ pub const Pardes = struct {
const from = p.active;
look.reopenAt(p, from, e.path, .{ .line = @max(1, j.line), .col = @max(1, j.col) });
const opened = p.panes[p.active] orelse return;
- if (p.active == from) return;
- p.jumps[@intCast(next)].pane = @intCast(p.active);
- p.jumps[@intCast(next)].serial = opened.serial;
+ const f = opened.file orelse return;
+ if (!std.mem.eql(u8, f.path, e.path)) return; // it did not open
+ // Every entry of that file is the reopened pane from here on, so
+ // a step onto another of them moves in it rather than reopening.
+ for (p.jumps[0..p.njumps]) |*k| if (k.serial == 0 and k.path_hash == j.path_hash) {
+ k.pane = @intCast(p.active);
+ k.serial = opened.serial;
+ };
p.jcur = @intCast(next);
return;
}