diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 11:11:09 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 536df266a4af38cf20ecb340337a6de2922e8902 (patch) | |
| tree | f283e2854bac73f012a90e2ea675b134350b1e9d /src/pardes.zig | |
| parent | 5db9e71ba32dd6f0a0292eaa341d1d8ba805483c (diff) | |
| download | pardes-536df266a4af38cf20ecb340337a6de2922e8902.tar.gz pardes-536df266a4af38cf20ecb340337a6de2922e8902.zip | |
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 <[email protected]>
Diffstat (limited to 'src/pardes.zig')
| -rw-r--r-- | src/pardes.zig | 11 |
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; } |
