mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 12:49:21 +02:00
SynEdit: paint always entire RTL token (prepare BIDI)
git-svn-id: trunk@39009 -
This commit is contained in:
parent
1e33006be2
commit
582a030f6b
@ -14,6 +14,7 @@ uses
|
|||||||
type
|
type
|
||||||
TLazSynDisplayTokenInfoEx = record
|
TLazSynDisplayTokenInfoEx = record
|
||||||
Tk: TLazSynDisplayTokenInfo;
|
Tk: TLazSynDisplayTokenInfo;
|
||||||
|
Attr: TSynSelectedColor;
|
||||||
StartPos: TLazSynDisplayTokenBound; // Start according to Logical flow. Left for LTR, or Right for RTL
|
StartPos: TLazSynDisplayTokenBound; // Start according to Logical flow. Left for LTR, or Right for RTL
|
||||||
EndPos: TLazSynDisplayTokenBound; // End according to Logical flow.
|
EndPos: TLazSynDisplayTokenBound; // End according to Logical flow.
|
||||||
// SreenRect Bounds. Ltr/RTL independent. Start is always left. End Always right
|
// SreenRect Bounds. Ltr/RTL independent. Start is always left. End Always right
|
||||||
@ -22,7 +23,8 @@ type
|
|||||||
PhysicalCharEnd: Integer; // 1 based - Full char bound (After EndPos.Physical (PaintEnd))
|
PhysicalCharEnd: Integer; // 1 based - Full char bound (After EndPos.Physical (PaintEnd))
|
||||||
PhysicalClipEnd: Integer; // 1 based - PaintEnd
|
PhysicalClipEnd: Integer; // 1 based - PaintEnd
|
||||||
RtlInfo: TLazSynDisplayRtlInfo;
|
RtlInfo: TLazSynDisplayRtlInfo;
|
||||||
Attr: TSynSelectedColor;
|
RtlExpandedExtraBytes: Integer; // tab and space expansion
|
||||||
|
RtlHasDoubleWidth: Boolean;
|
||||||
|
|
||||||
ExpandedExtraBytes: Integer; // tab and space expansion
|
ExpandedExtraBytes: Integer; // tab and space expansion
|
||||||
HasDoubleWidth: Boolean;
|
HasDoubleWidth: Boolean;
|
||||||
@ -59,9 +61,10 @@ type
|
|||||||
FCurViewScannerPhysCharPos: Integer; // 1 based - Full char bound (Before FCurViewScannerPos.Physical (PaintStart))
|
FCurViewScannerPhysCharPos: Integer; // 1 based - Full char bound (Before FCurViewScannerPos.Physical (PaintStart))
|
||||||
// RTL Run
|
// RTL Run
|
||||||
FCurViewinRTL: Boolean;
|
FCurViewinRTL: Boolean;
|
||||||
FCurViewRtlPhysStart: integer;
|
FCurViewRtlPhysStart, FCurViewRtlPhysEnd: integer;
|
||||||
FCurViewRtlPhysEnd: integer;
|
FCurViewRtlLogStart, FCurViewRtlLogEnd: integer;
|
||||||
FCurViewRtlLogEnd: integer;
|
FCurViewRtlExpExtraBytes: Integer; // tab and space expansion for entire RTL run
|
||||||
|
FCurViewRtlHasDoubleWidth: Boolean;
|
||||||
|
|
||||||
FNextMarkupPhysPos, FNextMarkupLogPos: Integer;
|
FNextMarkupPhysPos, FNextMarkupLogPos: Integer;
|
||||||
FCurMarkupNextStart: TLazSynDisplayTokenBound;
|
FCurMarkupNextStart: TLazSynDisplayTokenBound;
|
||||||
@ -100,6 +103,7 @@ type
|
|||||||
|
|
||||||
FCanvas: TCanvas;
|
FCanvas: TCanvas;
|
||||||
FTextDrawer: TheTextDrawer;
|
FTextDrawer: TheTextDrawer;
|
||||||
|
FEtoBuf: TEtoBuffer;
|
||||||
FTheLinesView: TSynEditStrings;
|
FTheLinesView: TSynEditStrings;
|
||||||
FHighlighter: TSynCustomHighlighter;
|
FHighlighter: TSynCustomHighlighter;
|
||||||
FMarkupManager: TSynEditMarkupManager;
|
FMarkupManager: TSynEditMarkupManager;
|
||||||
@ -559,17 +563,36 @@ function TLazSynPaintTokenBreaker.GetNextHighlighterTokenFromView(out
|
|||||||
|
|
||||||
procedure ChangeToRtl(ALogicIdx, ALogicEnd: Integer);
|
procedure ChangeToRtl(ALogicIdx, ALogicEnd: Integer);
|
||||||
var
|
var
|
||||||
RtlRunPhysWidth, j: Integer;
|
RtlRunPhysWidth, TabExtra, i, j: Integer;
|
||||||
pcw: TPhysicalCharWidth;
|
pcw: TPhysicalCharWidth;
|
||||||
|
HasDouble: Boolean;
|
||||||
|
c: Char;
|
||||||
begin
|
begin
|
||||||
|
FCurViewRtlLogStart := ALogicIdx;
|
||||||
pcw := GetCharWidthData(ALogicIdx);
|
pcw := GetCharWidthData(ALogicIdx);
|
||||||
|
|
||||||
RtlRunPhysWidth := 0;
|
RtlRunPhysWidth := 0;
|
||||||
|
i := 0;
|
||||||
|
HasDouble := False;
|
||||||
|
TabExtra := 0; // Extra bytes needed for expanded Tab/Space(utf8 visible space/dot)
|
||||||
j := (pcw and PCWMask);
|
j := (pcw and PCWMask);
|
||||||
while (ALogicIdx < ALogicEnd) and (pcw and PCWFlagRTL <> 0) do begin
|
while (ALogicIdx < ALogicEnd) and (pcw and PCWFlagRTL <> 0) do begin
|
||||||
inc(RtlRunPhysWidth, j);
|
inc(RtlRunPhysWidth, j);
|
||||||
|
|
||||||
|
if j <> 0 then begin
|
||||||
|
c := (FCurViewToken.TokenStart + i)^;
|
||||||
|
if c = #9 then
|
||||||
|
inc(TabExtra, j-1 + FTabExtraByteCount)
|
||||||
|
else
|
||||||
|
if j > 1 then
|
||||||
|
HasDouble := True;
|
||||||
|
if c = ' ' then
|
||||||
|
inc(TabExtra, FSpaceExtraByteCount);
|
||||||
|
end;
|
||||||
|
|
||||||
repeat
|
repeat
|
||||||
inc(ALogicIdx);
|
inc(ALogicIdx);
|
||||||
|
inc(i);
|
||||||
until (ALogicIdx >= ALogicEnd) or
|
until (ALogicIdx >= ALogicEnd) or
|
||||||
(ALogicIdx >= FCharWidthsLen) or ((FCharWidths[ALogicIdx] and PCWMask) <> 0);
|
(ALogicIdx >= FCharWidthsLen) or ((FCharWidths[ALogicIdx] and PCWMask) <> 0);
|
||||||
|
|
||||||
@ -577,12 +600,14 @@ function TLazSynPaintTokenBreaker.GetNextHighlighterTokenFromView(out
|
|||||||
j := pcw and PCWMask;
|
j := pcw and PCWMask;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
FCurViewinRTL := True;
|
FCurViewinRTL := True;
|
||||||
FCurViewRTLLogEnd := ALogicIdx;
|
FCurViewRTLLogEnd := ALogicIdx;
|
||||||
FCurViewRtlPhysStart := FCurViewScannerPhysCharPos;
|
FCurViewRtlPhysStart := FCurViewScannerPhysCharPos;
|
||||||
FCurViewRtlPhysEnd := FCurViewScannerPhysCharPos + RtlRunPhysWidth;
|
FCurViewRtlPhysEnd := FCurViewScannerPhysCharPos + RtlRunPhysWidth;
|
||||||
FCurViewScannerPhysCharPos := FCurViewRtlPhysEnd;
|
FCurViewScannerPhysCharPos := FCurViewRtlPhysEnd;
|
||||||
FCurViewScannerPos.Physical := FCurViewRtlPhysEnd;
|
FCurViewScannerPos.Physical := FCurViewRtlPhysEnd;
|
||||||
|
FCurViewRtlExpExtraBytes := TabExtra;
|
||||||
|
FCurViewRtlHasDoubleWidth := HasDouble;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function MaybeChangeToRtl(ALogicIdx, ALogicEnd: Integer): boolean; inline;
|
function MaybeChangeToRtl(ALogicIdx, ALogicEnd: Integer): boolean; inline;
|
||||||
@ -709,6 +734,10 @@ begin
|
|||||||
ATokenInfo.RtlInfo.IsRtl := False;
|
ATokenInfo.RtlInfo.IsRtl := False;
|
||||||
//ATokenInfo.RtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
//ATokenInfo.RtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
||||||
//ATokenInfo.RtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
//ATokenInfo.RtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
||||||
|
//ATokenInfo.RtlInfo.LogFirst := FCurViewRtlLogStart + 1;
|
||||||
|
//ATokenInfo.RtlInfo.LogLast := FCurViewRtlLogEnd + 1;
|
||||||
|
//ATokenInfo.RtlExpandedExtraBytes := FCurViewRtlExpExtraBytes;
|
||||||
|
//ATokenInfo.RtlHasDoubleWidth := FCurViewRtlHasDoubleWidth;
|
||||||
ATokenInfo.Attr := FCurViewAttr;
|
ATokenInfo.Attr := FCurViewAttr;
|
||||||
|
|
||||||
ATokenInfo.ExpandedExtraBytes := TabExtra;
|
ATokenInfo.ExpandedExtraBytes := TabExtra;
|
||||||
@ -747,6 +776,8 @@ begin
|
|||||||
ATokenInfo.NextRtlInfo.IsRtl := FCurViewinRTL;
|
ATokenInfo.NextRtlInfo.IsRtl := FCurViewinRTL;
|
||||||
ATokenInfo.NextRtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
ATokenInfo.NextRtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
||||||
ATokenInfo.NextRtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
ATokenInfo.NextRtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
||||||
|
ATokenInfo.NextRtlInfo.LogFirst := FCurViewRtlLogStart + 1;
|
||||||
|
ATokenInfo.NextRtlInfo.LogLast := FCurViewRtlLogEnd + 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
end; // case FCurViewinRTL = False;
|
end; // case FCurViewinRTL = False;
|
||||||
@ -826,6 +857,10 @@ begin
|
|||||||
ATokenInfo.RtlInfo.IsRtl := True;
|
ATokenInfo.RtlInfo.IsRtl := True;
|
||||||
ATokenInfo.RtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
ATokenInfo.RtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
||||||
ATokenInfo.RtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
ATokenInfo.RtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
||||||
|
ATokenInfo.RtlInfo.LogFirst := FCurViewRtlLogStart + 1;
|
||||||
|
ATokenInfo.RtlInfo.LogLast := FCurViewRtlLogEnd + 1;
|
||||||
|
ATokenInfo.RtlExpandedExtraBytes := FCurViewRtlExpExtraBytes;
|
||||||
|
ATokenInfo.RtlHasDoubleWidth := FCurViewRtlHasDoubleWidth;
|
||||||
ATokenInfo.Attr := FCurViewAttr;
|
ATokenInfo.Attr := FCurViewAttr;
|
||||||
|
|
||||||
ATokenInfo.ExpandedExtraBytes := TabExtra;
|
ATokenInfo.ExpandedExtraBytes := TabExtra;
|
||||||
@ -865,6 +900,8 @@ begin
|
|||||||
ATokenInfo.NextRtlInfo.IsRtl := FCurViewinRTL;
|
ATokenInfo.NextRtlInfo.IsRtl := FCurViewinRTL;
|
||||||
ATokenInfo.NextRtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
ATokenInfo.NextRtlInfo.PhysLeft := FCurViewRtlPhysStart;
|
||||||
ATokenInfo.NextRtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
ATokenInfo.NextRtlInfo.PhysRight := FCurViewRtlPhysEnd;
|
||||||
|
ATokenInfo.NextRtlInfo.LogFirst := FCurViewRtlLogStart + 1;
|
||||||
|
ATokenInfo.NextRtlInfo.LogLast := FCurViewRtlLogEnd + 1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
end; // case FCurViewinRTL = True;
|
end; // case FCurViewinRTL = True;
|
||||||
@ -1330,6 +1367,7 @@ var
|
|||||||
var
|
var
|
||||||
LineBuffer: PChar;
|
LineBuffer: PChar;
|
||||||
LineBufferLen: Integer;
|
LineBufferLen: Integer;
|
||||||
|
LineBufferRtlLogPos: Integer;
|
||||||
|
|
||||||
procedure DrawHiLightMarkupToken(ATokenInfo: TLazSynDisplayTokenInfoEx);
|
procedure DrawHiLightMarkupToken(ATokenInfo: TLazSynDisplayTokenInfoEx);
|
||||||
var
|
var
|
||||||
@ -1338,11 +1376,10 @@ var
|
|||||||
Attr: TSynSelectedColor;
|
Attr: TSynSelectedColor;
|
||||||
TxtFlags: Integer;
|
TxtFlags: Integer;
|
||||||
tok: TRect;
|
tok: TRect;
|
||||||
NeedExpansion: Boolean;
|
|
||||||
c, i, j, k, e, Len, CWLen: Integer;
|
c, i, j, k, e, Len, CWLen: Integer;
|
||||||
pl, pt: PChar;
|
pl, pt: PChar;
|
||||||
Eto: TEtoBuffer;
|
|
||||||
TxtLeft: Integer;
|
TxtLeft: Integer;
|
||||||
|
NeedExpansion, NeedTransform: Boolean;
|
||||||
begin
|
begin
|
||||||
Attr := ATokenInfo.Attr;
|
Attr := ATokenInfo.Attr;
|
||||||
FTextDrawer.SetForeColor(Attr.Foreground);
|
FTextDrawer.SetForeColor(Attr.Foreground);
|
||||||
@ -1363,7 +1400,6 @@ var
|
|||||||
|
|
||||||
//if (rcToken.Right <= rcToken.Left) then exit;
|
//if (rcToken.Right <= rcToken.Left) then exit;
|
||||||
rcToken.Left := ScreenColumnToXValue(ATokenInfo.PhysicalClipStart); // because for the first token, this can be middle of a char, and lead to wrong frame
|
rcToken.Left := ScreenColumnToXValue(ATokenInfo.PhysicalClipStart); // because for the first token, this can be middle of a char, and lead to wrong frame
|
||||||
TxtLeft := ScreenColumnToXValue(ATokenInfo.PhysicalCharStart); // because for the first token, this can be middle of a char, and lead to wrong frame
|
|
||||||
|
|
||||||
(* rcToken.Bottom may be less that crLine.Bottom. If a Divider was drawn, then RcToken will not contain it *)
|
(* rcToken.Bottom may be less that crLine.Bottom. If a Divider was drawn, then RcToken will not contain it *)
|
||||||
TxtFlags := ETO_OPAQUE;
|
TxtFlags := ETO_OPAQUE;
|
||||||
@ -1407,10 +1443,39 @@ var
|
|||||||
FTextDrawer.DrawFrame(tok);
|
FTextDrawer.DrawFrame(tok);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
if ATokenInfo.RtlInfo.IsRtl then begin
|
||||||
|
j := (ATokenInfo.StartPos.Logical - ATokenInfo.RtlInfo.LogFirst); // bytes in rtl-run, before TokenStart
|
||||||
|
i := (ATokenInfo.RtlInfo.LogLast - ATokenInfo.EndPos.Logical); // bytes in rtl-run, after TokenEnd
|
||||||
|
ATokenInfo.Tk.TokenStart := ATokenInfo.Tk.TokenStart - j;
|
||||||
|
ATokenInfo.Tk.TokenLength := ATokenInfo.Tk.TokenLength + j + i;
|
||||||
|
|
||||||
|
j := (ATokenInfo.EndPos.Physical - ATokenInfo.RtlInfo.PhysLeft);
|
||||||
|
i := (ATokenInfo.RtlInfo.PhysRight - ATokenInfo.StartPos.Physical);
|
||||||
|
ATokenInfo.PhysicalCharStart := ATokenInfo.PhysicalCharStart - j;
|
||||||
|
ATokenInfo.PhysicalCharEnd := ATokenInfo.PhysicalCharEnd + i;
|
||||||
|
|
||||||
|
ATokenInfo.StartPos.Logical := ATokenInfo.RtlInfo.LogFirst;
|
||||||
|
ATokenInfo.ExpandedExtraBytes := ATokenInfo.RtlExpandedExtraBytes;
|
||||||
|
ATokenInfo.HasDoubleWidth := ATokenInfo.RtlHasDoubleWidth;
|
||||||
|
end;
|
||||||
|
|
||||||
NeedExpansion := ATokenInfo.ExpandedExtraBytes > 0;
|
NeedExpansion := ATokenInfo.ExpandedExtraBytes > 0;
|
||||||
|
NeedTransform := FTextDrawer.NeedsEto or ATokenInfo.HasDoubleWidth or NeedExpansion;
|
||||||
Len := ATokenInfo.Tk.TokenLength;
|
Len := ATokenInfo.Tk.TokenLength;
|
||||||
Eto := nil;
|
if (not ATokenInfo.RtlInfo.IsRtl) or (LineBufferRtlLogPos <> ATokenInfo.RtlInfo.LogFirst) then
|
||||||
If FTextDrawer.NeedsEto or ATokenInfo.HasDoubleWidth or NeedExpansion then begin
|
FEtoBuf := nil;
|
||||||
|
|
||||||
|
If NeedTransform and ATokenInfo.RtlInfo.IsRtl and (LineBufferRtlLogPos = ATokenInfo.RtlInfo.LogFirst)
|
||||||
|
then begin
|
||||||
|
// allready done
|
||||||
|
if NeedExpansion then begin
|
||||||
|
ATokenInfo.Tk.TokenStart := LineBuffer;
|
||||||
|
ATokenInfo.Tk.TokenLength := Len + ATokenInfo.ExpandedExtraBytes;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
If NeedTransform then begin
|
||||||
|
LineBufferRtlLogPos := ATokenInfo.RtlInfo.LogFirst;
|
||||||
// prepare LineBuffer
|
// prepare LineBuffer
|
||||||
if NeedExpansion then begin
|
if NeedExpansion then begin
|
||||||
if (LineBufferLen < Len + ATokenInfo.ExpandedExtraBytes + 1) then begin
|
if (LineBufferLen < Len + ATokenInfo.ExpandedExtraBytes + 1) then begin
|
||||||
@ -1421,25 +1486,25 @@ var
|
|||||||
pt := ATokenInfo.Tk.TokenStart;
|
pt := ATokenInfo.Tk.TokenStart;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Prepare ETO
|
// Prepare FETOBuf
|
||||||
if FTextDrawer.NeedsEto or ATokenInfo.HasDoubleWidth then begin
|
if FTextDrawer.NeedsEto or ATokenInfo.HasDoubleWidth then begin
|
||||||
Eto := FTextDrawer.Eto;
|
FEtoBuf := FTextDrawer.Eto;
|
||||||
Eto.SetMinLength(Len + ATokenInfo.ExpandedExtraBytes + 1);
|
FEtoBuf.SetMinLength(Len + ATokenInfo.ExpandedExtraBytes + 1);
|
||||||
c := FTextDrawer.GetCharWidth;
|
c := FTextDrawer.GetCharWidth;
|
||||||
e := 0;
|
e := 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
CWLen := Length(CharWidths);
|
CWLen := Length(CharWidths);
|
||||||
|
|
||||||
// Copy to LineBuffer (and maybe eto
|
// Copy to LineBuffer (and maybe FetoBuf
|
||||||
if NeedExpansion then begin
|
if NeedExpansion then begin
|
||||||
j := ATokenInfo.StartPos.Logical - 1;
|
j := ATokenInfo.StartPos.Logical - 1;
|
||||||
for i := 0 to Len - 1 do begin
|
for i := 0 to Len - 1 do begin
|
||||||
if j < CWLen
|
if j < CWLen
|
||||||
then k := (CharWidths[j] and PCWMask)
|
then k := (CharWidths[j] and PCWMask)
|
||||||
else k := 1;
|
else k := 1;
|
||||||
if (k <> 0) and (eto <> nil) then begin
|
if (k <> 0) and (FetoBuf <> nil) then begin
|
||||||
Eto.EtoData[e] := k * c;
|
FEtoBuf.EtoData[e] := k * c;
|
||||||
inc(e);
|
inc(e);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1449,13 +1514,13 @@ var
|
|||||||
pl^ := #194; inc(pl);
|
pl^ := #194; inc(pl);
|
||||||
pl^ := #187; inc(pl);
|
pl^ := #187; inc(pl);
|
||||||
dec(k);
|
dec(k);
|
||||||
if eto <> nil then Eto.EtoData[e] := c;
|
if FetoBuf <> nil then FEtoBuf.EtoData[e] := c;
|
||||||
inc(e);
|
inc(e);
|
||||||
end;
|
end;
|
||||||
while k > 0 do begin
|
while k > 0 do begin
|
||||||
pl^ := ' '; inc(pl);
|
pl^ := ' '; inc(pl);
|
||||||
dec(k);
|
dec(k);
|
||||||
if eto <> nil then Eto.EtoData[e] := c;
|
if FetoBuf <> nil then FEtoBuf.EtoData[e] := c;
|
||||||
inc(e);
|
inc(e);
|
||||||
end;
|
end;
|
||||||
if (vscTabAtLast in FVisibleSpecialChars) and ((pl-1)^=' ') and (j < CWLen) then begin
|
if (vscTabAtLast in FVisibleSpecialChars) and ((pl-1)^=' ') and (j < CWLen) then begin
|
||||||
@ -1490,14 +1555,14 @@ var
|
|||||||
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
// ETO only
|
// FETOBuf only
|
||||||
begin
|
begin
|
||||||
for j := ATokenInfo.StartPos.Logical - 1 to ATokenInfo.StartPos.Logical - 1 + Len do begin
|
for j := ATokenInfo.StartPos.Logical - 1 to ATokenInfo.StartPos.Logical - 1 + Len do begin
|
||||||
if j < CWLen
|
if j < CWLen
|
||||||
then k := (CharWidths[j] and PCWMask)
|
then k := (CharWidths[j] and PCWMask)
|
||||||
else k := 1;
|
else k := 1;
|
||||||
if k <> 0 then begin
|
if k <> 0 then begin
|
||||||
Eto.EtoData[e] := k * c;
|
FEtoBuf.EtoData[e] := k * c;
|
||||||
inc(e);
|
inc(e);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1512,8 +1577,9 @@ var
|
|||||||
tok := rcToken;
|
tok := rcToken;
|
||||||
if rcToken.Right > nRightEdge + 1 then
|
if rcToken.Right > nRightEdge + 1 then
|
||||||
tok.Bottom := rcLine.Bottom;
|
tok.Bottom := rcLine.Bottom;
|
||||||
|
TxtLeft := ScreenColumnToXValue(ATokenInfo.PhysicalCharStart); // because for the first token, this can be middle of a char, and lead to wrong frame
|
||||||
fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
|
fTextDrawer.NewTextOut(TxtLeft, rcToken.Top, TxtFlags, tok,
|
||||||
ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, Eto);
|
ATokenInfo.Tk.TokenStart, ATokenInfo.Tk.TokenLength, FEtoBuf);
|
||||||
|
|
||||||
|
|
||||||
rcToken.Left := rcToken.Right;
|
rcToken.Left := rcToken.Right;
|
||||||
@ -1632,6 +1698,7 @@ begin
|
|||||||
|
|
||||||
LineBufferLen := 0;
|
LineBufferLen := 0;
|
||||||
LineBuffer := nil;
|
LineBuffer := nil;
|
||||||
|
LineBufferRtlLogPos := -1;
|
||||||
if Assigned(fHighlighter) then begin
|
if Assigned(fHighlighter) then begin
|
||||||
fHighlighter.CurrentLines := FTheLinesView;
|
fHighlighter.CurrentLines := FTheLinesView;
|
||||||
end;
|
end;
|
||||||
|
@ -32,8 +32,8 @@ uses
|
|||||||
type
|
type
|
||||||
TLazSynDisplayRtlInfo = record
|
TLazSynDisplayRtlInfo = record
|
||||||
IsRtl: Boolean;
|
IsRtl: Boolean;
|
||||||
PhysLeft: integer; // 1-based
|
PhysLeft, PhysRight: integer; // 1-based
|
||||||
PhysRight: integer;
|
LogFirst, LogLast: integer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TSynEditMarkupClass = class of TSynEditMarkup;
|
TSynEditMarkupClass = class of TSynEditMarkup;
|
||||||
|
Loading…
Reference in New Issue
Block a user