From 3bc83157e75b22911d4d2a99b6248621ea2bc100 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 5 May 2020 07:32:32 -0700 Subject: [PATCH] Showing last-used file when closing --- IDE/src/IDEApp.bf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index d05209e3..a008acf3 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -6011,6 +6011,9 @@ namespace IDE void ShowRecentFile(int idx, bool setFocus = true) { + if (idx >= mRecentlyDisplayedFiles.Count) + return; + String sourceFile = mRecentlyDisplayedFiles[idx]; if (sourceFile == DisassemblyPanel.sPanelName) { @@ -6183,6 +6186,12 @@ namespace IDE UpdateRecentDisplayedFilesMenuItems(); } + if (tabButton.mIsActive) + { + // If this succeeds then tabbUtton.mIsActive will be false, otherwise we do the 'nextTab' logic below + ShowRecentFile(0); + } + TabbedView.TabButton nextTab = null; bool foundRemovedTab = false; // Select the previous tab or the next one (if this is the first)