codetools: fixed TStandardCodeTool.CompleteBlock to not add anything if cursor in a comment

git-svn-id: trunk@53192 -
This commit is contained in:
mattias 2016-10-21 17:41:38 +00:00
parent b23106921b
commit cd1f78d608

View File

@ -6194,6 +6194,7 @@ var
var
Stack: TBlockStack;
CommentStart, CommentEnd: integer;
begin
Result:=false;
NewPos:=CursorPos;
@ -6201,6 +6202,12 @@ begin
BuildTreeAndGetCleanPos(trTillCursor,lsrEnd,CursorPos,CleanCursorPos,
[btSetIgnoreErrorPos]);
StartNode:=FindDeepestNodeAtPos(CleanCursorPos,true);
if CleanPosIsInComment(CleanCursorPos,StartNode.StartPos,CommentStart,CommentEnd) then begin
{$IFDEF VerboseCompleteBlock}
debugln(['TStandardCodeTool.CompleteBlock cursor (',CursorPos.Y,',',CursorPos.X,') cleanpos=[',CleanPosToStr(CleanCursorPos),'] in comment Start=[',CleanPosToStr(CommentStart),'] End=[',CleanPosToStr(CommentEnd),']']);
{$ENDIF}
exit;
end;
InternalCursorAtEmptyLine:=ebNone;
SourceChangeCache.MainScanner:=Scanner;