SynEdit: Textdrawer, fixed painting gaps past EOL (don't show special chars in gap before fold-indicator)

This commit is contained in:
Martin 2025-01-23 01:00:48 +01:00
parent a2153c9bcb
commit 949a6339ac

View File

@ -99,6 +99,7 @@ type
): Boolean; ): Boolean;
function GetNextHighlighterTokenEx(out ATokenInfo: TLazSynDisplayTokenInfoEx): Boolean; function GetNextHighlighterTokenEx(out ATokenInfo: TLazSynDisplayTokenInfoEx): Boolean;
property CharWidths: TPhysicalCharWidths read FCharWidths; property CharWidths: TPhysicalCharWidths read FCharWidths;
property CharWidthsLen: integer read FCharWidthsLen;
property ForegroundColor: TColor read FForegroundColor write FForegroundColor; property ForegroundColor: TColor read FForegroundColor write FForegroundColor;
property BackgroundColor: TColor read FBackgroundColor write FBackgroundColor; property BackgroundColor: TColor read FBackgroundColor write FBackgroundColor;
property SpaceExtraByteCount: Integer read FSpaceExtraByteCount write FSpaceExtraByteCount; property SpaceExtraByteCount: Integer read FSpaceExtraByteCount write FSpaceExtraByteCount;
@ -1549,6 +1550,7 @@ var
CurTextIndex: Integer; // Current Index in text CurTextIndex: Integer; // Current Index in text
dc: HDC; dc: HDC;
CharWidths: TPhysicalCharWidths; CharWidths: TPhysicalCharWidths;
CWLen: Integer;
var var
LineBuffer: PChar; LineBuffer: PChar;
@ -1562,7 +1564,7 @@ var
Attr: TSynSelectedColorMergeResult; Attr: TSynSelectedColorMergeResult;
TxtFlags: Integer; TxtFlags: Integer;
tok: TRect; tok: TRect;
c, i, j, k, e, Len, CWLen: Integer; c, i, j, k, e, Len: Integer;
pl, pt: PChar; pl, pt: PChar;
TxtLeft: Integer; TxtLeft: Integer;
NeedExpansion, NeedTransform: Boolean; NeedExpansion, NeedTransform: Boolean;
@ -1689,8 +1691,6 @@ var
c := 0; c := 0;
e := 0; e := 0;
CWLen := Length(CharWidths);
// Copy to LineBuffer (and maybe FetoBuf // Copy to LineBuffer (and maybe FetoBuf
if NeedExpansion then begin if NeedExpansion then begin
j := ATokenInfo.StartPos.Logical - 1; j := ATokenInfo.StartPos.Logical - 1;
@ -1828,6 +1828,7 @@ var
CharWidths := nil; // keep refcnt = 1 -- in case they get resized CharWidths := nil; // keep refcnt = 1 -- in case they get resized
FTokenBreaker.SetHighlighterTokensLine(TV + CurLine, CurTextIndex); FTokenBreaker.SetHighlighterTokensLine(TV + CurLine, CurTextIndex);
CharWidths := FTokenBreaker.CharWidths; CharWidths := FTokenBreaker.CharWidths;
CWLen := FTokenBreaker.CharWidthsLen;
fMarkupManager.PrepareMarkupForRow(CurTextIndex+1); fMarkupManager.PrepareMarkupForRow(CurTextIndex+1);
DividerInfo := DisplayView.GetDrawDividerInfo; // May call HL.SetRange DividerInfo := DisplayView.GetDrawDividerInfo; // May call HL.SetRange