summaryrefslogtreecommitdiffstats
path: root/editor/plugins/text_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/plugins/text_editor.cpp')
-rw-r--r--editor/plugins/text_editor.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/editor/plugins/text_editor.cpp b/editor/plugins/text_editor.cpp
index c7945e44f0..a2364278b6 100644
--- a/editor/plugins/text_editor.cpp
+++ b/editor/plugins/text_editor.cpp
@@ -352,27 +352,27 @@ void TextEditor::_edit_option(int p_op) {
switch (p_op) {
case EDIT_UNDO: {
tx->undo();
- tx->call_deferred(SNAME("grab_focus"));
+ callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_REDO: {
tx->redo();
- tx->call_deferred(SNAME("grab_focus"));
+ callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_CUT: {
tx->cut();
- tx->call_deferred(SNAME("grab_focus"));
+ callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_COPY: {
tx->copy();
- tx->call_deferred(SNAME("grab_focus"));
+ callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_PASTE: {
tx->paste();
- tx->call_deferred(SNAME("grab_focus"));
+ callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_SELECT_ALL: {
tx->select_all();
- tx->call_deferred(SNAME("grab_focus"));
+ callable_mp((Control *)tx, &Control::grab_focus).call_deferred();
} break;
case EDIT_MOVE_LINE_UP: {
code_editor->move_lines_up();
@@ -612,21 +612,6 @@ TextEditor::TextEditor() {
edit_hb = memnew(HBoxContainer);
- search_menu = memnew(MenuButton);
- search_menu->set_shortcut_context(this);
- edit_hb->add_child(search_menu);
- search_menu->set_text(TTR("Search"));
- search_menu->set_switch_on_hover(true);
- search_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option));
-
- search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND);
- search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT);
- search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV);
- search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE);
- search_menu->get_popup()->add_separator();
- search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_in_files"), SEARCH_IN_FILES);
- search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES);
-
edit_menu = memnew(MenuButton);
edit_menu->set_shortcut_context(this);
edit_hb->add_child(edit_menu);
@@ -685,6 +670,21 @@ TextEditor::TextEditor() {
add_syntax_highlighter(highlighter);
set_syntax_highlighter(plain_highlighter);
+ search_menu = memnew(MenuButton);
+ search_menu->set_shortcut_context(this);
+ edit_hb->add_child(search_menu);
+ search_menu->set_text(TTR("Search"));
+ search_menu->set_switch_on_hover(true);
+ search_menu->get_popup()->connect("id_pressed", callable_mp(this, &TextEditor::_edit_option));
+
+ search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find"), SEARCH_FIND);
+ search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_next"), SEARCH_FIND_NEXT);
+ search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_previous"), SEARCH_FIND_PREV);
+ search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace"), SEARCH_REPLACE);
+ search_menu->get_popup()->add_separator();
+ search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/find_in_files"), SEARCH_IN_FILES);
+ search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES);
+
MenuButton *goto_menu = memnew(MenuButton);
goto_menu->set_shortcut_context(this);
edit_hb->add_child(goto_menu);
@@ -712,5 +712,5 @@ TextEditor::~TextEditor() {
}
void TextEditor::validate() {
- this->code_editor->validate_script();
+ code_editor->validate_script();
}