summaryrefslogtreecommitdiff
path: root/editor/plugins/script_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-06-01 09:01:55 +0200
committerGitHub <noreply@github.com>2019-06-01 09:01:55 +0200
commit44bddecb8942c7be106a6d94538b2791c3948bd6 (patch)
tree8010d47eee469d6d2c27eab34b8d2e58f6b4a67f /editor/plugins/script_editor_plugin.cpp
parente9be875007bf109a8e2aab1fba1116f411979e14 (diff)
parentd33b4f4de824182464a7600d5645c250dfd84133 (diff)
Merge pull request #28695 from Ranoller/patch-2
FIX Script editor doesn´t send unsaved script #28693
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-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 839c9483d7..38be92a67f 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;