fix: don't auto find if there are already matches from some other operation

This commit is contained in:
CJ van den Berg 2025-11-10 12:11:17 +01:00
parent ced20a0fec
commit 491f40ed96
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1269,6 +1269,7 @@ pub fn handle_editor_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result
if (try m.match(.{ tp.any, tp.any, "none" })) if (try m.match(.{ tp.any, tp.any, "none" }))
return self.clear_auto_find(editor); return self.clear_auto_find(editor);
if (try m.match(.{ tp.any, tp.any, tp.extract(&sel.begin.row), tp.extract(&sel.begin.col), tp.extract(&sel.end.row), tp.extract(&sel.end.col) })) { if (try m.match(.{ tp.any, tp.any, tp.extract(&sel.begin.row), tp.extract(&sel.begin.col), tp.extract(&sel.end.row), tp.extract(&sel.end.col) })) {
if (editor.have_matches()) return;
sel.normalize(); sel.normalize();
if (sel.end.row - sel.begin.row > ed.max_match_lines) if (sel.end.row - sel.begin.row > ed.max_match_lines)
return self.clear_auto_find(editor); return self.clear_auto_find(editor);