diff --git a/atsynedit/atsynedit.pas b/atsynedit/atsynedit.pas index f60fef131..06c91f28b 100644 --- a/atsynedit/atsynedit.pas +++ b/atsynedit/atsynedit.pas @@ -2720,6 +2720,7 @@ procedure TATSynEdit.DoPaintTextTo(C: TCanvas; TextOutProps.NeedOffsets:= FFontNeedsOffsets; TextOutProps.TabHelper:= FTabHelper; TextOutProps.LineIndex:= NLinesIndex; + TextOutProps.CharIndexInLine:= WrapItem.NCharIndex; TextOutProps.CharSize:= ACharSize; TextOutProps.MainTextArea:= AMainText; TextOutProps.CharsSkipped:= NOutputSpacesSkipped; @@ -6810,6 +6811,7 @@ procedure TATSynEdit.DoPaintTextFragmentTo(C: TCanvas; true); TextOutProps.LineIndex:= WrapItem.NLineIndex; + TextOutProps.CharIndexInLine:= WrapItem.NCharIndex; CanvasTextOut(C, cSizeIndentTooltipX, cSizeIndentTooltipY + FCharSize.Y*(NLine-ALineFrom), diff --git a/atsynedit/atsynedit_canvasproc.pas b/atsynedit/atsynedit_canvasproc.pas index 61c44cb9d..b52d1b8ed 100644 --- a/atsynedit/atsynedit_canvasproc.pas +++ b/atsynedit/atsynedit_canvasproc.pas @@ -92,6 +92,7 @@ TATCanvasTextOutProps = record NeedOffsets: TATFontNeedsOffsets; TabHelper: TATStringTabHelper; LineIndex: integer; + CharIndexInLine: integer; CharSize: TPoint; MainTextArea: boolean; CharsSkipped: integer; @@ -883,7 +884,7 @@ procedure CanvasTextOut(C: TCanvas; APosX, APosY: integer; AText: atString; if AProps.ShowUnprintedSpacesOnlyInSelection then begin for i:= 1 to Length(AText) do - if AProps.DetectIsPosSelected(i-1, AProps.LineIndex) then + if AProps.DetectIsPosSelected(i-2+AProps.CharIndexInLine, AProps.LineIndex) then DoPaintUnprintedChar(C, AText[i], i, ListInt, Point(APosX, APosY), AProps.CharSize, AProps.ColorUnprintedFont); end else