diff --git a/modules/text_editor/text_editor_vanilla_editor.cpp b/modules/text_editor/text_editor_vanilla_editor.cpp index 723884b23..4724ba57c 100644 --- a/modules/text_editor/text_editor_vanilla_editor.cpp +++ b/modules/text_editor/text_editor_vanilla_editor.cpp @@ -14,6 +14,8 @@ #include "scene/gui/text_edit.h" #include "scene/gui/texture_rect.h" +#include "editor/code_editor.h" + #include "scene/resources/dynamic_font.h" String TextEditorVanillaEditor::get_current_path() { @@ -177,8 +179,10 @@ void TextEditorVanillaEditor::count_characters() { } void TextEditorVanillaEditor::open_search_box() { + _find_replace_bar->popup_search(); } void TextEditorVanillaEditor::open_replace_box() { + _find_replace_bar->popup_replace(); } TextEditorVanillaEditor::TextEditorVanillaEditor() { @@ -229,6 +233,10 @@ TextEditorVanillaEditor::TextEditorVanillaEditor() { text_editor->set("custom_constants/completion_max_width", 20); text_editor->set("custom_constants/completion_scroll_width", 20); + _find_replace_bar = memnew(FindReplaceBar); + _find_replace_bar->set_text_edit(text_editor); + add_child(_find_replace_bar); + HBoxContainer *file_info = memnew(HBoxContainer); add_child(file_info); diff --git a/modules/text_editor/text_editor_vanilla_editor.h b/modules/text_editor/text_editor_vanilla_editor.h index a727ee5eb..cc1375a1b 100644 --- a/modules/text_editor/text_editor_vanilla_editor.h +++ b/modules/text_editor/text_editor_vanilla_editor.h @@ -17,6 +17,7 @@ class CheckBox; class Button; class TextureRect; class Label; +class FindReplaceBar; class TextEditorVanillaEditor : public VBoxContainer { GDCLASS(TextEditorVanillaEditor, VBoxContainer); @@ -64,6 +65,8 @@ protected: Label *file_info_c_counter; CheckBox *file_info_read_only; + FindReplaceBar *_find_replace_bar; + String current_path; String current_filename;