SynEdit: add ETO_RTLREADING to tokendrawer, required if wrapped text starts with weak RTL char

This commit is contained in:
Martin 2025-02-10 11:06:36 +01:00
parent ad7e912a49
commit b96f00e77f

View File

@ -1652,8 +1652,10 @@ var
end;
if ATokenInfo.RtlInfo.IsRtl then begin
// Always draw the entire RTL run, to keep weak chars in context.
// Alternatively, could use ETO_RTLREADING
// Always draw the entire RTL run, to keep weak chars in context. Alternatively, could use ETO_RTLREADING
// Need ETO_RTLREADING anyway when wrapping leads to leading weakchars in token
TxtFlags := TxtFlags + ETO_RTLREADING;
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;