From e3195bd15b0a17e238d802374fc5deb967cbf726 Mon Sep 17 00:00:00 2001 From: kit Date: Tue, 11 Jun 2024 15:56:38 -0400 Subject: [PATCH] Fix find highlight when switching scripts --- editor/code_editor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 0e272429a3ee..c80dc9df3d81 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -653,6 +653,7 @@ void FindReplaceBar::set_text_edit(CodeTextEditor *p_text_editor) { } if (base_text_editor) { + text_editor->set_search_text(String()); base_text_editor->remove_find_replace_bar(); base_text_editor = nullptr; text_editor->disconnect("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed)); @@ -670,8 +671,7 @@ void FindReplaceBar::set_text_edit(CodeTextEditor *p_text_editor) { text_editor = base_text_editor->get_text_editor(); text_editor->connect("text_changed", callable_mp(this, &FindReplaceBar::_editor_text_changed)); - _update_results_count(); - _update_matches_display(); + _editor_text_changed(); } void FindReplaceBar::_bind_methods() {