diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 9106bf56e77..2ce605b6273 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -731,6 +731,9 @@ void ScriptEditor::_close_tab(int p_idx) { apply_scripts(); } + // roll back to previous tab + _history_back(); + //remove from history history.resize(history_pos + 1);