mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 02:36:07 +02:00
Codetools: Add a new uses-section right after interface/implementation keyword. Issue #19901, patch from Anton.
git-svn-id: trunk@31878 -
This commit is contained in:
parent
41fbd0d144
commit
f9a84e9f2f
@ -957,15 +957,10 @@ begin
|
|||||||
usImplementation: SectionNode:=FindImplementationNode;
|
usImplementation: SectionNode:=FindImplementationNode;
|
||||||
end;
|
end;
|
||||||
if SectionNode<>nil then begin
|
if SectionNode<>nil then begin
|
||||||
// add uses to existing interface/implementation behind title and directives
|
// add uses to existing interface/implementation before any content
|
||||||
if SectionNode.FirstChild<>nil then begin
|
MoveCursorToNodeStart(SectionNode);
|
||||||
// section not empty => add in front of first node
|
ReadNextAtom;
|
||||||
InsertPos:=FindLineEndOrCodeInFrontOfPosition(SectionNode.FirstChild.StartPos,
|
InsertPos := CurPos.EndPos;
|
||||||
true);
|
|
||||||
end else begin
|
|
||||||
// section empty => add at end of interface section
|
|
||||||
InsertPos:=FindLineEndOrCodeInFrontOfPosition(SectionNode.EndPos,true);
|
|
||||||
end;
|
|
||||||
end else begin
|
end else begin
|
||||||
// section is missing => add it
|
// section is missing => add it
|
||||||
SectionNode:=Tree.Root;
|
SectionNode:=Tree.Root;
|
||||||
|
Loading…
Reference in New Issue
Block a user