IDE: fixed loading default unit when no lps exists

git-svn-id: trunk@46778 -
This commit is contained in:
mattias 2014-11-07 14:59:42 +00:00
parent 001b440270
commit ba6f0da620

View File

@ -1030,7 +1030,7 @@ type
function GetCompileSourceFilename: string; function GetCompileSourceFilename: string;
procedure AutoAddOutputDirToIncPath; procedure AutoAddOutputDirToIncPath;
// state file // compile state file
function LoadStateFile(IgnoreErrors: boolean): TModalResult; function LoadStateFile(IgnoreErrors: boolean): TModalResult;
function SaveStateFile(const CompilerFilename, CompilerParams: string; function SaveStateFile(const CompilerFilename, CompilerParams: string;
Complete: boolean): TModalResult; Complete: boolean): TModalResult;
@ -5684,7 +5684,10 @@ var
AnUnitInfo: TUnitInfo; AnUnitInfo: TUnitInfo;
BestUnitInfo: TUnitInfo; BestUnitInfo: TUnitInfo;
begin begin
if FirstUnitWithEditorIndex<>nil then exit; BestUnitInfo:=FirstUnitWithEditorIndex;
if (BestUnitInfo<>nil) and (BestUnitInfo.Loaded)
and FileExistsCached(BestUnitInfo.Filename) then
exit;
BestUnitInfo:=nil; BestUnitInfo:=nil;
if (MainUnitID>=0) then begin if (MainUnitID>=0) then begin