From 5dea682202a91335973faa84aa8a5cf6ab6620b7 Mon Sep 17 00:00:00 2001 From: n7800 <14154601-n7800@users.noreply.gitlab.com> Date: Sat, 18 Jan 2025 05:34:01 +0500 Subject: [PATCH] IDE/Menu: Add open LPI/LPK to only recent projects/packages (not files) if they were opened as a project/package. Issues #39554, #41297 --- ide/sourcefilemanager.pas | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ide/sourcefilemanager.pas b/ide/sourcefilemanager.pas index 8519e59b54..b5ca528f13 100644 --- a/ide/sourcefilemanager.pas +++ b/ide/sourcefilemanager.pas @@ -1284,10 +1284,6 @@ begin exit(mrCancel); end; - if ([ofAddToRecent,ofRevert,ofVirtualFile]*FFlags=[ofAddToRecent]) - and (FFilename<>'') and FilenameIsAbsolute(FFilename) then - EnvironmentOptions.AddToRecentOpenFiles(FFilename); - // check if this is a hidden unit: // if this is the main unit, it is already // loaded and needs only to be shown in the sourceeditor/formeditor @@ -1347,6 +1343,10 @@ begin if Result <> mrOK then exit; end; + if ([ofAddToRecent,ofRevert,ofVirtualFile]*FFlags=[ofAddToRecent]) + and (FFilename<>'') and FilenameIsAbsolute(FFilename) then + EnvironmentOptions.AddToRecentOpenFiles(FFilename); + if (FNewEditorInfo <> nil) and (ofAddToProject in FFlags) and (not FNewUnitInfo.IsPartOfProject) then begin FNewUnitInfo.IsPartOfProject:=true;