summaryrefslogtreecommitdiff
path: root/src/builtins.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtins.zig')
-rw-r--r--src/builtins.zig11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index 074d1328..21dd4fa9 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -1,6 +1,7 @@
//! Command structs and runtime settings form the builtin registry; bindings live in config.zig.
const std = @import("std");
const pardes = @import("pardes.zig");
+const look = @import("look.zig");
const edit = @import("edit.zig");
const colors = @import("colors.zig");
const Pardes = pardes.Pardes;
@@ -213,7 +214,7 @@ pub const Look = struct {
// name on the message row would only be noise over that
pub const quiet = true;
pub fn run(c: Ctx) void {
- c.p.lookAt(c.id, c.arg orelse return);
+ look.lookAt(c.p, c.id, c.arg orelse return);
}
};
@@ -711,7 +712,7 @@ pub const Find = struct {
pub const output: OutputTraits = .{ .name = config.search_buffer, .steps = true };
pub fn run(c: Ctx) void {
const pat = std.mem.trim(u8, c.arg orelse "", " \t\r\n");
- if (pat.len > 0) return c.p.runSearch(c.id, pat, .find, .top) catch |err|
+ if (pat.len > 0) return look.runSearch(c.p, c.id, pat, .find, .top) catch |err|
c.p.reportError(c.id, "find", err);
c.p.startPrompt(c.pane, .{ .search = config.find_marker });
}
@@ -724,7 +725,7 @@ pub const Grep = struct {
pub const output: OutputTraits = .{ .name = config.search_buffer, .steps = true, .locations = true };
pub fn run(c: Ctx) void {
const pat = std.mem.trim(u8, c.arg orelse "", " \t\r\n");
- if (pat.len > 0) return c.p.runSearch(c.id, pat, .grep, .top) catch |err|
+ if (pat.len > 0) return look.runSearch(c.p, c.id, pat, .grep, .top) catch |err|
c.p.reportError(c.id, "grep", err);
c.p.startPrompt(c.pane, .{ .search = config.grep_marker });
}
@@ -779,11 +780,11 @@ pub const Last = struct {
i -= 1;
const j = c.p.jumps[i];
// Restore the cursor without recentering the pane's retained view.
- if (j.pane != c.id) return c.p.focusPaneLine(j.pane, .{ .line = j.line, .col = j.col }, .keep);
+ if (j.pane != c.id) return look.focusPaneLine(c.p, j.pane, .{ .line = j.line, .col = j.col }, .keep);
}
// Nothing on the jumplist to go back to, which is the ordinary case
// for a pane that opened beside this one and was never focused.
- if (c.p.neighbourPane(c.id)) |next| c.p.focusPaneLine(next, .{ .line = 0, .col = 0 }, .keep);
+ if (c.p.neighbourPane(c.id)) |next| look.focusPaneLine(c.p, next, .{ .line = 0, .col = 0 }, .keep);
}
};