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)