mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
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
(cherry picked from commit df84290a7e
)
This commit is contained in:
parent
83b76a8171
commit
317cb336eb
4 changed files with 22 additions and 13 deletions
|
@ -497,7 +497,7 @@ void ScriptEditor::_open_recent_script(int p_idx) {
|
|||
}
|
||||
}
|
||||
|
||||
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())
|
||||
|
@ -517,7 +517,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);
|
||||
|
@ -575,7 +577,7 @@ void ScriptEditor::_close_docs_tab() {
|
|||
EditorHelp *se = Object::cast_to<EditorHelp>(tab_container->get_child(i));
|
||||
|
||||
if (se) {
|
||||
_close_tab(i);
|
||||
_close_tab(i, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue