mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-31 17:40:30 +02:00
ide: try to open unitinfo with non-expanded file name (required to open non-saved units)
git-svn-id: trunk@26545 -
This commit is contained in:
parent
3e688d4f5d
commit
241b11f6b3
17
ide/main.pp
17
ide/main.pp
@ -4790,12 +4790,19 @@ var
|
||||
LFMCode: TCodeBuffer;
|
||||
AFilename: String;
|
||||
begin
|
||||
AFilename:=CleanAndExpandFilename(UnitFilename);
|
||||
if not FileExistsInIDE(AFilename,[]) then begin
|
||||
DebugLn(['TMainIDE.DoOpenComponent file not found ',AFilename]);
|
||||
exit(mrCancel);
|
||||
end;
|
||||
// try to find a unit name without expaning the path. this is required if unit is virtual
|
||||
// in other case file name will be expanded with the wrong path
|
||||
AFilename := UnitFilename;
|
||||
AnUnitInfo:=Project1.UnitInfoWithFilename(AFilename);
|
||||
if AnUnitInfo = nil then
|
||||
begin
|
||||
AFilename:=CleanAndExpandFilename(UnitFilename);
|
||||
if not FileExistsInIDE(AFilename,[]) then begin
|
||||
DebugLn(['TMainIDE.DoOpenComponent file not found ',AFilename]);
|
||||
exit(mrCancel);
|
||||
end;
|
||||
AnUnitInfo:=Project1.UnitInfoWithFilename(AFilename);
|
||||
end;
|
||||
if (not (ofRevert in OpenFlags))
|
||||
and (AnUnitInfo<>nil) and (AnUnitInfo.Component<>nil) then begin
|
||||
// already open
|
||||
|
Loading…
Reference in New Issue
Block a user