fix: disambiguate find and find_query commands

This commit is contained in:
CJ van den Berg 2024-08-18 22:03:17 +02:00
parent ea31e414ee
commit 2d9e66b534
2 changed files with 2 additions and 2 deletions

View file

@ -3007,7 +3007,7 @@ pub const Editor = struct {
try self.close_dirty(); 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; var query: []const u8 = undefined;
if (ctx.args.match(.{tp.extract(&query)}) catch false) { if (ctx.args.match(.{tp.extract(&query)}) catch false) {
try self.find_in_buffer(query); try self.find_in_buffer(query);

View file

@ -501,7 +501,7 @@ pub fn handle_editor_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result
if (text.len == 0) if (text.len == 0)
return self.clear_auto_find(editor); return self.clear_auto_find(editor);
if (!self.is_last_match_text(text)) { 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; return;