From f8fe738416fe3a40a7136f2cb5528e8fd57f40df Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 20:09:32 -0300 Subject: Recent and /recent keep PDFs and images as they keep files, and an open file's row is where its dot is now Only text files were recorded, so a PDF read yesterday was not there to find again, and an open file's row showed the place it last closed at, stale by however far it had moved since. A PDF is kept at its page and reopened there from its row; an image by its path; an open one's row reads its pane's place at the time of the listing. Co-Authored-By: Claude Opus 5.5 --- src/Output.zig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/Output.zig') diff --git a/src/Output.zig b/src/Output.zig index 06f2f1dc..4aa0c021 100644 --- a/src/Output.zig +++ b/src/Output.zig @@ -612,10 +612,16 @@ pub fn openJumps(p: *Pardes, id: usize) !void { /// The recent list as rows: `:: open|closed`, most recent /// first; a look at a row opens the file there, as a +Jumps row does. pub fn recentText(p: *Pardes, w: *std.Io.Writer, look_rows: bool) !void { - for (p.recent.entries.items) |e| { + for (p.recent.entries.items) |stored| { + // An open one's row is where it is now, not where it last closed. + var e = stored; var is_open = false; - for (p.panes) |slot| if (slot) |pane| if (pane.file) |f| if (f.output == null and std.mem.eql(u8, f.path, e.path)) { + for (p.panes) |slot| if (slot) |pane| if (Pardes.recentPlace(pane)) |d| if (std.mem.eql(u8, d.path, e.path)) { is_open = true; + e.line = d.line; + e.col = d.col; + e.aline = d.aline; + e.acol = d.acol; }; const state: []const u8 = if (is_open) "open" else "(closed)"; if (!look_rows) { -- cgit v1.3