mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 14:39:13 +02:00
IDE+codetools: replaced some FindFile calls with LoadFile
git-svn-id: trunk@16775 -
This commit is contained in:
parent
0e57f86bb5
commit
2011685e93
@ -399,6 +399,7 @@ begin
|
|||||||
NewBuffer.LastIncludedByFile:=FindIncludeLink(AFilename);
|
NewBuffer.LastIncludedByFile:=FindIncludeLink(AFilename);
|
||||||
end else begin
|
end else begin
|
||||||
NewBuffer.Source:=OldBuffer.Source;
|
NewBuffer.Source:=OldBuffer.Source;
|
||||||
|
NewBuffer.IsDeleted:=false;
|
||||||
Result:=NewBuffer.Save;
|
Result:=NewBuffer.Save;
|
||||||
end;
|
end;
|
||||||
if not Result then exit;
|
if not Result then exit;
|
||||||
|
@ -1060,7 +1060,7 @@ begin
|
|||||||
case CurrentPage of
|
case CurrentPage of
|
||||||
cepCode:
|
cepCode:
|
||||||
begin
|
begin
|
||||||
CodeBuffer:=CodeToolBoss.FindFile(CodeFilename);
|
CodeBuffer:=CodeToolBoss.LoadFile(CodeFilename,false,false);
|
||||||
if CodeBuffer=nil then exit;
|
if CodeBuffer=nil then exit;
|
||||||
ACodeTool:=nil;
|
ACodeTool:=nil;
|
||||||
CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
|
CodeToolBoss.Explore(CodeBuffer,ACodeTool,false);
|
||||||
@ -1070,7 +1070,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
cepDirectives:
|
cepDirectives:
|
||||||
begin
|
begin
|
||||||
CodeBuffer:=CodeToolBoss.FindFile(DirectivesFilename);
|
CodeBuffer:=CodeToolBoss.LoadFile(DirectivesFilename,false,false);
|
||||||
if CodeBuffer=nil then exit;
|
if CodeBuffer=nil then exit;
|
||||||
CodeBuffer.AbsoluteToLineCol(CurNode.StartPos,Caret.Y,Caret.X);
|
CodeBuffer.AbsoluteToLineCol(CurNode.StartPos,Caret.Y,Caret.X);
|
||||||
if Caret.Y<1 then exit;
|
if Caret.Y<1 then exit;
|
||||||
|
@ -143,7 +143,7 @@ begin
|
|||||||
for i := 0 to Project1.JumpHistory.Count -1 do begin
|
for i := 0 to Project1.JumpHistory.Count -1 do begin
|
||||||
jh_item := Project1.JumpHistory.Items[i];
|
jh_item := Project1.JumpHistory.Items[i];
|
||||||
SrcLine:='';
|
SrcLine:='';
|
||||||
CodeBuf:=CodeToolBoss.FindFile(jh_item.Filename);
|
CodeBuf:=CodeToolBoss.LoadFile(jh_item.Filename,false,False);
|
||||||
if CodeBuf<>nil then
|
if CodeBuf<>nil then
|
||||||
SrcLine:=CodeBuf.GetLine(jh_item.CaretXY.Y-1);
|
SrcLine:=CodeBuf.GetLine(jh_item.CaretXY.Y-1);
|
||||||
Filename:=jh_item.Filename;
|
Filename:=jh_item.Filename;
|
||||||
|
@ -312,7 +312,7 @@ procedure TQuickFixLinkerUndefinedReference.Execute(const Msg: TIDEMessageLine;
|
|||||||
Error('no main file in project');
|
Error('no main file in project');
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
CodeBuf:=CodeToolBoss.FindFile(CurProject.MainFile.Filename);
|
CodeBuf:=CodeToolBoss.LoadFile(CurProject.MainFile.Filename,true,false);
|
||||||
if (CodeBuf=nil) then begin
|
if (CodeBuf=nil) then begin
|
||||||
Error('project main file has no source');
|
Error('project main file has no source');
|
||||||
exit;
|
exit;
|
||||||
|
@ -310,7 +310,7 @@ begin
|
|||||||
|
|
||||||
lStartPos := StrToInt(lItem.SubItems[3]);
|
lStartPos := StrToInt(lItem.SubItems[3]);
|
||||||
|
|
||||||
CodeBuffer := CodeToolBoss.FindFile(MainFilename);
|
CodeBuffer := CodeToolBoss.LoadFile(MainFilename,false,false);
|
||||||
if CodeBuffer = nil then
|
if CodeBuffer = nil then
|
||||||
Exit; //==>
|
Exit; //==>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user