From ca869ce1fce17eccc06a44c5f0f3f3bedf5e9058 Mon Sep 17 00:00:00 2001 From: mattias Date: Thu, 3 Dec 2009 10:40:59 +0000 Subject: [PATCH] IDE: when there is no lps file: open the main unit if it does not contain automatic statements git-svn-id: trunk@22938 - --- ide/project.pp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ide/project.pp b/ide/project.pp index d19c6ce6cc..c086fc4201 100644 --- a/ide/project.pp +++ b/ide/project.pp @@ -2447,9 +2447,18 @@ var BestUnitInfo: TUnitInfo; begin if FirstUnitWithEditorIndex<>nil then exit; - - AnUnitInfo:=FirstPartOfProject; + BestUnitInfo:=nil; + + if (MainUnitID>=0) + and ([pfMainUnitHasCreateFormStatements,pfMainUnitHasTitleStatement]*Flags=[]) + then begin + // the main unit contains no automatic statements + // open the main unit + BestUnitInfo:=MainUnitInfo; + end; + + AnUnitInfo:=FirstPartOfProject; while AnUnitInfo<>nil do begin if (BestUnitInfo=nil) or (FilenameIsPascalUnit(AnUnitInfo.Filename)