From 2d9e66b53424d831ed9b9c0c92291a8b01e796d8 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 18 Aug 2024 22:03:17 +0200 Subject: [PATCH] fix: disambiguate find and find_query commands --- src/tui/editor.zig | 2 +- src/tui/mainview.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tui/editor.zig b/src/tui/editor.zig index 6d87045..49bf916 100644 --- a/src/tui/editor.zig +++ b/src/tui/editor.zig @@ -3007,7 +3007,7 @@ pub const Editor = struct { try self.close_dirty(); } - pub fn find(self: *Self, ctx: Context) Result { + pub fn find_query(self: *Self, ctx: Context) Result { var query: []const u8 = undefined; if (ctx.args.match(.{tp.extract(&query)}) catch false) { try self.find_in_buffer(query); diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index b3fd419..f5020d1 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -501,7 +501,7 @@ pub fn handle_editor_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result if (text.len == 0) return self.clear_auto_find(editor); if (!self.is_last_match_text(text)) { - tp.self_pid().send(.{ "cmd", "find", .{text} }) catch return; + tp.self_pid().send(.{ "cmd", "find_query", .{text} }) catch return; } } return;