Make "Close and save changes?" actually save

This fixes issue #39844, where the confirmation dialog when a user
attempts to close an unsaved script did not actually save it even after
clicking "Save."
This commit is contained in:
Daniel Ting 2020-06-30 21:39:12 -05:00
parent e820a73f58
commit d2a5b92e9b
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected)); ScriptEditorBase *current = Object::cast_to<ScriptEditorBase>(tab_container->get_child(selected));
if (current) { if (current) {
if (p_save) { if (p_save) {
apply_scripts(); _menu_option(FILE_SAVE);
} }
Ref<Script> script = current->get_edited_resource(); Ref<Script> script = current->get_edited_resource();