From b9f24f15863fe9c427826194421a3701a10fca71 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sat, 14 Jan 2023 15:58:15 +0000 Subject: [PATCH] Remove secondary carets when using FindReplaceBar --- editor/code_editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ba7e7f2877c..df8adf01e41 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -143,6 +143,7 @@ void FindReplaceBar::unhandled_input(const Ref &p_event) { } bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) { + text_editor->remove_secondary_carets(); String text = get_search_text(); Point2i pos = text_editor->search(text, p_flags, p_from_line, p_from_col); @@ -178,6 +179,7 @@ bool FindReplaceBar::_search(uint32_t p_flags, int p_from_line, int p_from_col) } void FindReplaceBar::_replace() { + text_editor->remove_secondary_carets(); bool selection_enabled = text_editor->has_selection(0); Point2i selection_begin, selection_end; if (selection_enabled) { @@ -225,6 +227,7 @@ void FindReplaceBar::_replace() { } void FindReplaceBar::_replace_all() { + text_editor->remove_secondary_carets(); text_editor->disconnect("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed)); // Line as x so it gets priority in comparison, column as y. Point2i orig_cursor(text_editor->get_caret_line(0), text_editor->get_caret_column(0));