diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2023-01-15 00:12:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 00:12:46 +0100 |
commit | f7c5dbaeee63c1eca26e768afdbf2d4850273140 (patch) | |
tree | 2670a4221b13fc1b4225e1fedb16d013b41c6a72 | |
parent | 03d11e608e978f299b4e7061fbe7bf126d26b667 (diff) | |
parent | b9f24f15863fe9c427826194421a3701a10fca71 (diff) |
Merge pull request #71404 from Paulb23/fix-multi-caret-searchbar
Remove secondary carets when using FindReplaceBar
-rw-r--r-- | editor/code_editor.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index ba7e7f2877..df8adf01e4 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -143,6 +143,7 @@ void FindReplaceBar::unhandled_input(const Ref<InputEvent> &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)); |