fix: do not auto_find if the selection is already a match
This commit is contained in:
parent
dc077350cd
commit
5362966a59
1 changed files with 1 additions and 1 deletions
|
|
@ -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" }))
|
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_not_of_type(.auto_find)) return;
|
|
||||||
if (!tui.config().enable_auto_find) return;
|
if (!tui.config().enable_auto_find) return;
|
||||||
|
if (editor.find_selection_match(sel)) |_| 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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue