This commit is contained in:
Seif Soliman 2026-01-08 19:03:14 +02:00 committed by GitHub
commit 1895670c18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -405,8 +405,15 @@ export class Caret {
isLanguageRightToLeft: boolean;
isDirectionReversed: boolean;
}): { left: number; top: number; width: number } {
// in zen, custom or polyglot mode we need to check per-letter
const checkRtlByLetter =
Config.mode === "zen" ||
Config.mode === "custom" ||
Config.funbox.includes("polyglot");
const [isWordRTL, isFullMatch] = isWordRightToLeft(
options.wordText,
checkRtlByLetter
? (options.letter.native.textContent ?? "")
: options.wordText,
options.isLanguageRightToLeft,
options.isDirectionReversed,
);
@ -455,7 +462,7 @@ export class Caret {
// yes, this is all super verbose, but its easier to maintain and understand
if (isWordRTL) {
if (isFullMatch) options.word.addClass("wordRtl");
if (!checkRtlByLetter && isFullMatch) options.word.addClass("wordRtl");
let afterLetterCorrection = 0;
if (options.side === "afterLetter") {
if (this.isFullWidth()) {