From 845bf2bab75149096b613ab0405c09b31c9f3bd8 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 6 Oct 2021 01:51:39 +0300 Subject: [PATCH] Fixes critical bug that is caused by removing a project tab that is to the left of the currently active tab --- src/UI/Tabs.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/UI/Tabs.gd b/src/UI/Tabs.gd index 37f86ef8e..be3f73559 100644 --- a/src/UI/Tabs.gd +++ b/src/UI/Tabs.gd @@ -44,5 +44,8 @@ func delete_tab(tab : int) -> void: Global.current_project_index -= 1 else: Global.current_project_index = 0 + else: + if tab < Global.current_project_index: + Global.current_project_index -= 1 if Global.unsaved_changes_dialog.is_connected("confirmed", self, "delete_tab"): Global.unsaved_changes_dialog.disconnect("confirmed", self, "delete_tab")