diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 8d9c817d9dd..f6daaecf7e0 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1462,8 +1462,6 @@ void CodeTextEditor::set_edit_state(const Variant &p_state) { text_editor->set_line_as_bookmark(bookmarks[i], true); } } - - text_editor->grab_focus(); } void CodeTextEditor::set_error(const String &p_error) { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 99c3d87168f..d8620f2dab2 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -580,7 +580,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { Node *tselected = tab_container->get_child(selected); - ScriptEditorBase *current = Object::cast_to(tab_container->get_child(selected)); + ScriptEditorBase *current = Object::cast_to(tselected); if (current) { Ref