From df84290a7ee2e4e939fc4eccc030129227c83895 Mon Sep 17 00:00:00 2001 From: volzhs Date: Wed, 7 Feb 2018 06:32:03 +0900 Subject: Keep to show current script when closing all docs also fix error when removing multiple tabs from TabContainer at same frame. like closing multiple docs at once. Fix #16403 --- editor/plugins/script_editor_plugin.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'editor/plugins/script_editor_plugin.cpp') diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index bd8c502a8..ce71cf328 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -505,7 +505,7 @@ void ScriptEditor::_show_error_dialog(String p_path) { error_dialog->popup_centered_minsize(); } -void ScriptEditor::_close_tab(int p_idx, bool p_save) { +void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) { int selected = p_idx; if (selected < 0 || selected >= tab_container->get_child_count()) @@ -521,7 +521,9 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) { } // roll back to previous tab - _history_back(); + if (p_history_back) { + _history_back(); + } //remove from history history.resize(history_pos + 1); @@ -579,7 +581,7 @@ void ScriptEditor::_close_docs_tab() { EditorHelp *se = Object::cast_to(tab_container->get_child(i)); if (se) { - _close_tab(i); + _close_tab(i, true, false); } } } -- cgit v1.2.3-70-g09d2