diff options
author | Ranoller <davarrcal@hotmail.com> | 2019-05-05 06:56:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-05 06:56:19 +0200 |
commit | d33b4f4de824182464a7600d5645c250dfd84133 (patch) | |
tree | e8102c3f22bb1661efdccdecc179e9e3869921ea | |
parent | 84401e8cdf4f41fc0e804bf5410622e75a08c0f5 (diff) |
FIX Script editor doesn´t send unsaved script #28693
This commit fix #28693.
Script editor doesn´t send unsaved version of a script in editor_script_changed signal (sends disk stored version) unless you close other script and apply_scripts() is performed.
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 8 |
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; |