mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:39:25 +02:00
codetools: fixed clearing include file link
This commit is contained in:
parent
35dab68891
commit
89476ec791
@ -1349,7 +1349,8 @@ end;
|
|||||||
function TCodeBuffer.GetLastIncludedByFile: string;
|
function TCodeBuffer.GetLastIncludedByFile: string;
|
||||||
begin
|
begin
|
||||||
Result:=FLastIncludedByFile;
|
Result:=FLastIncludedByFile;
|
||||||
if Result=Filename then Result:='';
|
if CompareFilenames(Result,Filename)=0 then
|
||||||
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCodeBuffer.SetFilename(Value: string);
|
procedure TCodeBuffer.SetFilename(Value: string);
|
||||||
|
@ -5955,7 +5955,7 @@ var ActiveSrcEdit:TSourceEditor;
|
|||||||
UnitLineCountWithIncludes: LongInt;
|
UnitLineCountWithIncludes: LongInt;
|
||||||
UnitLineCountParsed: LongInt;
|
UnitLineCountParsed: LongInt;
|
||||||
Code: TCodeBuffer;
|
Code: TCodeBuffer;
|
||||||
CTTool: TCodeTool;
|
CTTool, aCodeTool: TCodeTool;
|
||||||
TreeOfSourceCodes: TAVLTree;
|
TreeOfSourceCodes: TAVLTree;
|
||||||
Node: TAVLTreeNode;
|
Node: TAVLTreeNode;
|
||||||
SubCode: TCodeBuffer;
|
SubCode: TCodeBuffer;
|
||||||
@ -6015,8 +6015,12 @@ begin
|
|||||||
TrimSearchPath(CodeToolBoss.GetIncludePathForDirectory(FileDir),FileDir),
|
TrimSearchPath(CodeToolBoss.GetIncludePathForDirectory(FileDir),FileDir),
|
||||||
TrimSearchPath(CodeToolBoss.GetCompleteSrcPathForDirectory(FileDir),FileDir)
|
TrimSearchPath(CodeToolBoss.GetCompleteSrcPathForDirectory(FileDir),FileDir)
|
||||||
);
|
);
|
||||||
if ClearIncludedByFile then
|
if ClearIncludedByFile then begin
|
||||||
ActiveUnitInfo.Source.LastIncludedByFile:='';
|
ActiveUnitInfo.Source.LastIncludedByFile:='';
|
||||||
|
CodeToolBoss.SourceCache.ClearIncludedByEntry(ActiveUnitInfo.Source.Filename);
|
||||||
|
CodeToolBoss.Explore(ActiveUnitInfo.Source,aCodeTool,false,true);
|
||||||
|
SaveIncludeLinks;
|
||||||
|
end;
|
||||||
if (DlgResult=mrYes) and (ActiveUnitInfo.Source.LastIncludedByFile<>'') then
|
if (DlgResult=mrYes) and (ActiveUnitInfo.Source.LastIncludedByFile<>'') then
|
||||||
DoGotoIncludeDirective;
|
DoGotoIncludeDirective;
|
||||||
end;
|
end;
|
||||||
|
@ -57,10 +57,10 @@ type
|
|||||||
PathsGroupBox: TGroupBox;
|
PathsGroupBox: TGroupBox;
|
||||||
procedure CodeToolsDefsButtonClick(Sender: TObject);
|
procedure CodeToolsDefsButtonClick(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure clearIncludedByClick(Sender: TObject);
|
procedure ClearIncludedByClick(Sender: TObject);
|
||||||
private
|
private
|
||||||
FFilePath: string;
|
FFilePath: string;
|
||||||
function getIncludedBy: string;
|
function GetIncludedBy: string;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function ShowUnitInfoDlg(const AnUnitName, AType: string;
|
function ShowUnitInfoDlg(const AnUnitName, AType: string;
|
||||||
@ -130,7 +130,7 @@ begin
|
|||||||
|
|
||||||
Result:=Dlg.ShowModal;
|
Result:=Dlg.ShowModal;
|
||||||
ClearIncludedBy:=(Result in [mrOk,mrYes]) and (IncludedBy<>'')
|
ClearIncludedBy:=(Result in [mrOk,mrYes]) and (IncludedBy<>'')
|
||||||
and (Dlg.getIncludedBy='');
|
and (Dlg.GetIncludedBy='');
|
||||||
Dlg.Free;
|
Dlg.Free;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -166,12 +166,12 @@ begin
|
|||||||
GotoIncludeDirectiveButton.Caption:=lisMenuGotoIncludeDirective;
|
GotoIncludeDirectiveButton.Caption:=lisMenuGotoIncludeDirective;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TUnitInfoDialog.clearIncludedByClick(Sender: TObject);
|
procedure TUnitInfoDialog.ClearIncludedByClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
ListValues.Items[6].SubItems[0]:='';
|
ListValues.Items[6].SubItems[0]:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TUnitInfoDialog.getIncludedBy: string;
|
function TUnitInfoDialog.GetIncludedBy: string;
|
||||||
begin
|
begin
|
||||||
Result:=ListValues.Items[6].SubItems[0];
|
Result:=ListValues.Items[6].SubItems[0];
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user