mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 12:00:15 +02:00
codetools: fixed TStandardCodeTool.CompleteBlock to not add anything if cursor in a comment
git-svn-id: trunk@53192 -
This commit is contained in:
parent
b23106921b
commit
cd1f78d608
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user