IDE: open file at cursor: simple search relative to active unit

git-svn-id: trunk@34087 -
This commit is contained in:
mattias 2011-12-10 16:52:40 +00:00
parent 5522c80015
commit 4b65d3903d

View File

@ -10363,10 +10363,14 @@ begin
if FName='' then exit;
// check if absolute filename
if FilenameIsAbsolute(FName) and FileExistsUTF8(FName) then
Found:=true;
if FilenameIsAbsolute(FName) then begin
if FileExistsUTF8(FName) then
Found:=true
else
exit;
end;
if (not Found) and (not FilenameIsAbsolute(FName)) then begin
if (not Found) then begin
if IsIncludeDirective then begin
// search include file
SPath:='.;'+CodeToolBoss.DefineTree.GetIncludePathForDirectory(BaseDir);
@ -10387,6 +10391,15 @@ begin
end;
end;
if (not Found) then begin
// simple search relative to current unit
InFilename:=AppendPathDelim(BaseDir)+FName;
if FileExistsCached(InFilename) then begin
Found:=true;
FName:=InFilename;
end;
end;
if (not Found) and (System.Pos('.',FName)>0) and (not IsIncludeDirective) then
begin
// for example 'SysUtils.CompareText'