File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -405,8 +405,15 @@ export class Caret {
405405 isLanguageRightToLeft : boolean ;
406406 isDirectionReversed : boolean ;
407407 } ) : { left : number ; top : number ; width : number } {
408+ // in zen, custom or polyglot mode we need to check per-letter
409+ const checkRtlByLetter =
410+ Config . mode === "zen" ||
411+ Config . mode === "custom" ||
412+ Config . funbox . includes ( "polyglot" ) ;
408413 const [ isWordRTL , isFullMatch ] = isWordRightToLeft (
409- options . wordText ,
414+ checkRtlByLetter
415+ ? ( options . letter . native . textContent ?? "" )
416+ : options . wordText ,
410417 options . isLanguageRightToLeft ,
411418 options . isDirectionReversed ,
412419 ) ;
@@ -455,7 +462,7 @@ export class Caret {
455462
456463 // yes, this is all super verbose, but its easier to maintain and understand
457464 if ( isWordRTL ) {
458- if ( isFullMatch ) options . word . addClass ( "wordRtl" ) ;
465+ if ( ! checkRtlByLetter && isFullMatch ) options . word . addClass ( "wordRtl" ) ;
459466 let afterLetterCorrection = 0 ;
460467 if ( options . side === "afterLetter" ) {
461468 if ( this . isFullWidth ( ) ) {
You can’t perform that action at this time.
0 commit comments