mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 07:42:59 +02:00
fixed inserting code in front of delphi comment
git-svn-id: trunk@3161 -
This commit is contained in:
parent
14c83e35c1
commit
a344dfcdf7
@ -93,9 +93,9 @@ type
|
|||||||
function NodeExtIsVariable(ANodeExt: TCodeTreeNodeExtension): boolean;
|
function NodeExtIsVariable(ANodeExt: TCodeTreeNodeExtension): boolean;
|
||||||
function NodeExtIsPrivate(ANodeExt: TCodeTreeNodeExtension): boolean;
|
function NodeExtIsPrivate(ANodeExt: TCodeTreeNodeExtension): boolean;
|
||||||
procedure FindInsertPositionForForwardProc(
|
procedure FindInsertPositionForForwardProc(
|
||||||
SourceChangeCache: TSourceChangeCache;
|
SourceChangeCache: TSourceChangeCache;
|
||||||
ProcNode: TCodeTreeNode;
|
ProcNode: TCodeTreeNode;
|
||||||
var Indent, InsertPos: integer);
|
var Indent, InsertPos: integer);
|
||||||
function CheckLocalVarAssignmentSyntax(CleanCursorPos: integer;
|
function CheckLocalVarAssignmentSyntax(CleanCursorPos: integer;
|
||||||
var VarNameAtom,AssignmentOperator,TermAtom: TAtomPosition): boolean;
|
var VarNameAtom,AssignmentOperator,TermAtom: TAtomPosition): boolean;
|
||||||
function AddLocalVariable(CleanCursorPos: integer; OldTopLine: integer;
|
function AddLocalVariable(CleanCursorPos: integer; OldTopLine: integer;
|
||||||
@ -398,10 +398,11 @@ begin
|
|||||||
// sort forward proc definitions with source position
|
// sort forward proc definitions with source position
|
||||||
ForwardProcNodes.OnCompare:=@CompareCodeTreeNodeExtWithNodeStartPos;
|
ForwardProcNodes.OnCompare:=@CompareCodeTreeNodeExtWithNodeStartPos;
|
||||||
|
|
||||||
{ProcAVLNode:=ForwardProcNodes.FindLowest;
|
{ For debugging:
|
||||||
|
ProcAVLNode:=ForwardProcNodes.FindLowest;
|
||||||
while ProcAVLNode<>nil do begin
|
while ProcAVLNode<>nil do begin
|
||||||
NearestProcNode:=TCodeTreeNodeExtension(ProcAVLNode.Data).Node;
|
NearestProcNode:=TCodeTreeNodeExtension(ProcAVLNode.Data).Node;
|
||||||
writeln('AAA1 ',NearestProcNode.StartPos,' "',copy(Src,NearestProcNode.StartPos,20),'"');
|
writeln('FindInsertPositionForForwardProc B ',NearestProcNode.StartPos,' "',copy(Src,NearestProcNode.StartPos,20),'"');
|
||||||
ProcAVLNode:=ForwardProcNodes.FindSuccessor(ProcAVLNode);
|
ProcAVLNode:=ForwardProcNodes.FindSuccessor(ProcAVLNode);
|
||||||
end;}
|
end;}
|
||||||
|
|
||||||
@ -410,7 +411,7 @@ begin
|
|||||||
if NearestAVLNode<>nil then begin
|
if NearestAVLNode<>nil then begin
|
||||||
NearestNodeExt:=TCodeTreeNodeExtension(NearestAVLNode.Data);
|
NearestNodeExt:=TCodeTreeNodeExtension(NearestAVLNode.Data);
|
||||||
NearestProcNode:=NearestNodeExt.Node;
|
NearestProcNode:=NearestNodeExt.Node;
|
||||||
//writeln('AAA1 ',NearestProcNode.StartPos,' "',copy(Src,NearestProcNode.StartPos,20),'"');
|
//writeln('FindInsertPositionForForwardProc C ',NearestProcNode.StartPos,' "',copy(Src,NearestProcNode.StartPos,20),'"');
|
||||||
InsertBehind:=NearestProcNode.StartPos<ProcNode.StartPos;
|
InsertBehind:=NearestProcNode.StartPos<ProcNode.StartPos;
|
||||||
|
|
||||||
// the corresponding body was linked by IntersectProcNodes in Data
|
// the corresponding body was linked by IntersectProcNodes in Data
|
||||||
|
Loading…
Reference in New Issue
Block a user