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.
This commit is contained in:
Ranoller 2019-05-05 06:56:19 +02:00 committed by GitHub
parent 84401e8cdf
commit d33b4f4de8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;