IDE/Menu: Add open LPI/LPK to only recent projects/packages (not files) if they were opened as a project/package. Issues #39554, #41297

This commit is contained in:
n7800 2025-01-18 05:34:01 +05:00
parent bfd5b97aab
commit 5dea682202

View File

@ -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;