diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index eb4755a048..d79f699d78 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -10710,7 +10710,7 @@ begin Highlighter.SetRange(TSynEditStringList(Lines).Ranges[PosY]); Highlighter.SetLine(Line, PosY); PosX := XY.X; - if (PosX > 0) and (PosX <= Length(Line)) then + if (PosX > 0) and (PosX <= Length(Line)) then begin while not Highlighter.GetEol do begin Start := Highlighter.GetTokenPos + 1; Token := Highlighter.GetToken; @@ -10722,6 +10722,7 @@ begin end; Highlighter.Next; end; + end; end; Token := ''; Attri := nil; diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index cbe65a2405..494f122665 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -3274,7 +3274,8 @@ procedure TSourceNotebook.OnSourceCompletionTimer(Sender: TObject); // check if in a comment Token:=''; - Attri:=nil; + Attri:=nil; + dec(LogCaret.X); if SrcEdit.EditorComponent.GetHighlighterAttriAtRowCol(LogCaret,Token,Attri) and (Attri<>nil) and (Attri.Name=SYNS_AttrComment) then begin