summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 7fdf2176..2247fcbb 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -1447,6 +1447,7 @@ pub const Last = struct {
while (i > 0) {
i -= 1;
const j = c.p.jumps[i];
+ if (j.serial == 0) continue; // a closed file's: Back reopens it, Last goes to a pane
// Restore the cursor without recentering the pane's retained view.
if (j.pane != c.id) return look.focusPaneLine(c.p, j.pane, .{ .line = j.line, .col = j.col }, .keep);
}
@@ -1456,6 +1457,15 @@ pub const Last = struct {
}
};
+/// List the files opened lately, closed ones too, each a place to open again.
+pub const Recent = struct {
+ pub const scope: Scope = .session;
+ pub const output: OutputTraits = .{ .name = config.recent_buffer, .steps = true, .locations = true };
+ pub fn run(c: Ctx) void {
+ panes.Output.openRecent(c.p, c.id) catch |err| c.p.reportError(c.id, "recent", err);
+ }
+};
+
/// List the places jumped from, each a place to go.
pub const Jumplist = struct {
pub const scope: Scope = .session;