summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-08 12:00:28 -0300
committerGabriel Schneider <[email protected]>2026-10-22 10:03:15 -0300
commit13d5613b77c62c425c3a124a34c0c2528cc6251f (patch)
treef3cbe41683ef31641ea087039db9fc3be81e141f /src/builtins.zig
parent046979b877f02a91cf52cc86b84c5619cb9363d3 (diff)
downloadpardes-13d5613b77c62c425c3a124a34c0c2528cc6251f.tar.gz
pardes-13d5613b77c62c425c3a124a34c0c2528cc6251f.zip
Follow Helix search registers for n/N; keep Look navigation as named builtins
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig32
1 files changed, 23 insertions, 9 deletions
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 {