From 536df266a4af38cf20ecb340337a6de2922e8902 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 11:11:09 -0300 Subject: One reopen of a closed file is that file's pane in every jumplist entry A Back that reopened a file updated only the entry it stepped onto; another entry for the same file stayed closed, and stepping onto it re-looked the file, found it already active and returned without moving, so Forward (or Back) did nothing. Co-Authored-By: Claude Opus 5.5 --- src/pardes.zig | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/pardes.zig') 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; } -- cgit v1.3