diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 18095261fa..21bca33069 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -4215,6 +4215,7 @@ var end; // search comment in front of declaration + //debugln(['FindDeclarationNode search comment in front: ',DeclarationTool=Self,' SkipComments=',SkipComments,' Identifier=',Identifier]); if (DeclarationTool=Self) and (not SkipComments) and FindCommentInFront(DeclarationNode.StartPos,Identifier, diff --git a/components/codetools/pascalreadertool.pas b/components/codetools/pascalreadertool.pas index 5fd9a68775..31092e6815 100644 --- a/components/codetools/pascalreadertool.pas +++ b/components/codetools/pascalreadertool.pas @@ -2381,7 +2381,6 @@ var end; var - CleanCursorPos: integer; ANode: TCodeTreeNode; p: LongInt; CommentLvl: Integer; @@ -2431,7 +2430,7 @@ begin MoveCursorToCleanPos(ANode.StartPos); end; - //debugln('TPascalReaderTool.FindCommentInFront B Area="',copy(Src,CurPos.StartPos,CleanCursorPos-CurPos.StartPos),'"'); + //debugln('TPascalReaderTool.FindCommentInFront B Area="',copy(Src,CurPos.StartPos,StartPos-CurPos.StartPos),'"'); FoundStartPos:=-1; repeat @@ -2501,7 +2500,7 @@ begin end; ReadNextAtom; //DebugLn('TPascalReaderTool.FindCommentInFront NextAtom=',GetAtom); - until (CurPos.EndPos>=CleanCursorPos) or (CurPos.EndPos>=SrcLen); + until (CurPos.StartPos>=StartPos) or (CurPos.EndPos>=SrcLen); Result:=(FoundStartPos>=1); CommentStart:=FoundStartPos;