From 39061340035e94a2fb43273ca32601c7c8a811b6 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Sat, 22 Jul 2017 10:08:56 +0100 Subject: [PATCH] Fixed script tab selection on file close, issue 8400 --- editor/plugins/script_editor_plugin.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index aeb16f13eeb..774d3d79546 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -32,13 +32,13 @@ #include "editor/editor_node.h" #include "editor/editor_settings.h" #include "editor/script_editor_debugger.h" -#include "project_settings.h" #include "io/resource_loader.h" #include "io/resource_saver.h" #include "os/file_access.h" #include "os/input.h" #include "os/keyboard.h" #include "os/os.h" +#include "project_settings.h" #include "scene/main/viewport.h" /*** SCRIPT EDITOR ****/ @@ -518,6 +518,9 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) { _add_recent_script(help->get_class()); } + // roll back to previous tab + _history_back(); + //remove from history history.resize(history_pos + 1);