IDE: default loaded unit: check if file exists

git-svn-id: trunk@40190 -
This commit is contained in:
mattias 2013-02-05 09:45:01 +00:00
parent f8c92431ec
commit d1f1fbe675
2 changed files with 8 additions and 6 deletions

View File

@ -3329,11 +3329,13 @@ var
if BestUnitInfo=nil then begin
AnUnitInfo:=FirstPartOfProject;
while AnUnitInfo<>nil do begin
if (BestUnitInfo=nil)
or (FilenameIsPascalUnit(AnUnitInfo.Filename)
and (not FilenameIsPascalUnit(BestUnitInfo.Filename)))
then begin
BestUnitInfo:=AnUnitInfo;
if FileExistsCached(AnUnitInfo.Filename) then begin
if (BestUnitInfo=nil)
or (FilenameIsPascalUnit(AnUnitInfo.Filename)
and (not FilenameIsPascalUnit(BestUnitInfo.Filename)))
then begin
BestUnitInfo:=AnUnitInfo;
end;
end;
AnUnitInfo:=AnUnitInfo.NextPartOfProject;
end;

View File

@ -1799,7 +1799,7 @@ begin
end
else begin
// reopen file
// This will adjust Page/WindowIndex if they are not continious
// This will adjust Page/WindowIndex if they are not continous
Result:=OpenEditorFile(AnUnitInfo.Filename, -1, AnEditorInfo.WindowID,
AnEditorInfo, [ofProjectLoading,ofMultiOpen,ofOnlyIfExists], True);
if Result=mrAbort then