mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-20 10:19:23 +02:00
IDE: open file at cursor: simple search relative to active unit
git-svn-id: trunk@34087 -
This commit is contained in:
parent
5522c80015
commit
4b65d3903d
19
ide/main.pp
19
ide/main.pp
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user