From 13d5613b77c62c425c3a124a34c0c2528cc6251f Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 8 Oct 2026 12:00:28 -0300 Subject: Follow Helix search registers for n/N; keep Look navigation as named builtins --- src/builtins.zig | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'src/builtins.zig') diff --git a/src/builtins.zig b/src/builtins.zig index c1424b2f..ef769b48 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -744,15 +744,15 @@ pub const Restore = struct { // so a Restore that could never happen spends no warning. if (comptime pardes.hosted) { const bytes = @import("fs.zig").readRestore(c.p.gpa, path, c.p.settings.dump_dir.get()) catch |err| { - var buf: [limits.host_path_cap + 64]u8 = undefined; - var words: [128]u8 = undefined; - const why = switch (err) { - error.FileNotFound => "no such file", - error.PermissionDenied => "permission denied", - error.IsDirectory => "a directory, not a dump", - else => pardes.Messages.errorWords(err, &words), - }; - return c.p.reportFailure(c.id, std.fmt.bufPrint(&buf, "Restore: {s}: {s}", .{ path, why }) catch "Restore: cannot read the dump"); + var buf: [limits.host_path_cap + 64]u8 = undefined; + var words: [128]u8 = undefined; + const why = switch (err) { + error.FileNotFound => "no such file", + error.PermissionDenied => "permission denied", + error.IsDirectory => "a directory, not a dump", + else => pardes.Messages.errorWords(err, &words), + }; + return c.p.reportFailure(c.id, std.fmt.bufPrint(&buf, "Restore: {s}: {s}", .{ path, why }) catch "Restore: cannot read the dump"); }; defer c.p.gpa.free(bytes); // Nor does a file that is not a dump, before any warning. @@ -1837,6 +1837,20 @@ pub const Forward = struct { } }; +/// Select the next Look location across panes; Enter opens it. +pub const LookNext = struct { + pub fn run(c: Ctx) void { + look.lookWalk(c.p, 1); + } +}; + +/// Select the previous Look location across panes; Enter opens it. +pub const LookPrev = struct { + pub fn run(c: Ctx) void { + look.lookWalk(c.p, -1); + } +}; + /// Go back to the last place jumped from in another pane. pub const Last = struct { pub fn run(c: Ctx) void { -- cgit v1.3