summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/plugins/script_editor_plugin.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 92579e5cef..f2d6b3b7d7 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -388,6 +388,14 @@ void ScriptEditor::_save_history() {
void ScriptEditor::_go_to_tab(int p_idx) {
+ ScriptEditorBase *current = _get_current_editor();
+ if (current) {
+ if (current->is_unsaved()) {
+
+ current->apply_code();
+ }
+ }
+
Control *c = Object::cast_to<Control>(tab_container->get_child(p_idx));
if (!c)
return;