mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 06:16:05 +02:00
codetools: fixed adding uses section to program
git-svn-id: branches/fixes_1_8@56233 -
This commit is contained in:
parent
7626be6016
commit
e9854d69b2
@ -961,7 +961,7 @@ function TStandardCodeTool.AddUnitToSpecificUsesSection(UsesSection: TUsesSectio
|
|||||||
const NewUnitName, NewUnitInFile: string; SourceChangeCache: TSourceChangeCache;
|
const NewUnitName, NewUnitInFile: string; SourceChangeCache: TSourceChangeCache;
|
||||||
AsLast: boolean; CheckSpecialUnits: boolean): boolean;
|
AsLast: boolean; CheckSpecialUnits: boolean): boolean;
|
||||||
var
|
var
|
||||||
UsesNode, OtherUsesNode, SectionNode: TCodeTreeNode;
|
UsesNode, OtherUsesNode, SectionNode, Node: TCodeTreeNode;
|
||||||
NewUsesTerm: string;
|
NewUsesTerm: string;
|
||||||
InsertPos: integer;
|
InsertPos: integer;
|
||||||
Junk: TAtomPosition;
|
Junk: TAtomPosition;
|
||||||
@ -1047,8 +1047,11 @@ begin
|
|||||||
if InsertPos<1 then begin
|
if InsertPos<1 then begin
|
||||||
// not a unit (i.e. program)
|
// not a unit (i.e. program)
|
||||||
// => insert after title and directives
|
// => insert after title and directives
|
||||||
if SectionNode.Next<>nil then begin
|
Node:=SectionNode.Next;
|
||||||
InsertPos:=FindLineEndOrCodeInFrontOfPosition(SectionNode.Next.StartPos,
|
if (Node<>nil) and (Node.Desc=ctnSrcName) then
|
||||||
|
Node:=Node.NextSkipChilds;
|
||||||
|
if Node<>nil then begin
|
||||||
|
InsertPos:=FindLineEndOrCodeInFrontOfPosition(Node.StartPos,
|
||||||
true);
|
true);
|
||||||
end else begin
|
end else begin
|
||||||
// program empty => add at end
|
// program empty => add at end
|
||||||
|
Loading…
Reference in New Issue
Block a user