mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-23 23:08:33 +02:00
IDE: when there is no lps file: open the main unit if it does not contain automatic statements
git-svn-id: trunk@22938 -
This commit is contained in:
parent
1efc58041e
commit
ca869ce1fc
@ -2447,9 +2447,18 @@ var
|
|||||||
BestUnitInfo: TUnitInfo;
|
BestUnitInfo: TUnitInfo;
|
||||||
begin
|
begin
|
||||||
if FirstUnitWithEditorIndex<>nil then exit;
|
if FirstUnitWithEditorIndex<>nil then exit;
|
||||||
|
|
||||||
AnUnitInfo:=FirstPartOfProject;
|
|
||||||
BestUnitInfo:=nil;
|
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
|
while AnUnitInfo<>nil do begin
|
||||||
if (BestUnitInfo=nil)
|
if (BestUnitInfo=nil)
|
||||||
or (FilenameIsPascalUnit(AnUnitInfo.Filename)
|
or (FilenameIsPascalUnit(AnUnitInfo.Filename)
|
||||||
|
Loading…
Reference in New Issue
Block a user