From 5362966a5901d88eedcddcd8291e83fcbb1842aa Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 14 Jan 2026 12:57:06 +0100 Subject: [PATCH] fix: do not auto_find if the selection is already a match --- src/tui/mainview.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tui/mainview.zig b/src/tui/mainview.zig index 7c75fb8..50830a9 100644 --- a/src/tui/mainview.zig +++ b/src/tui/mainview.zig @@ -1496,8 +1496,8 @@ pub fn handle_editor_event(self: *Self, _: tp.pid_ref, m: tp.message) tp.result if (try m.match(.{ tp.any, tp.any, "none" })) 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 (editor.have_matches_not_of_type(.auto_find)) return; if (!tui.config().enable_auto_find) return; + if (editor.find_selection_match(sel)) |_| return; sel.normalize(); if (sel.end.row - sel.begin.row > ed.max_match_lines) return self.clear_auto_find(editor);