diff options
author | Eli Zaretskii <eliz@gnu.org> | 2020-07-25 19:25:02 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2020-07-25 19:25:02 +0300 |
commit | 4b3085a7fe8980432aa63ddf614fee2a6fb04e94 (patch) | |
tree | 6356d0f8c1a71e77ebe9a614443189f4e10cc110 /src | |
parent | efdd4632c95cc6be6efc099cfed051022fff7a84 (diff) | |
download | emacs-4b3085a7fe8980432aa63ddf614fee2a6fb04e94.tar.gz |
Fix last change
* src/composite.c (composition_reseat_it): Fix of the commentary,
and a minor change of the last fix.
Diffstat (limited to 'src')
-rw-r--r-- | src/composite.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/composite.c b/src/composite.c index 2fbe6796b59..a5288cb8a25 100644 --- a/src/composite.c +++ b/src/composite.c @@ -1171,7 +1171,9 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos, character to check, and CHARPOS and BYTEPOS are indices in the string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi embedding level of the current paragraph, and is used to calculate the - direction argument to pass to the font shaper. + direction argument to pass to the font shaper; value of -1 means the + caller doesn't know the embedding level (used by callers which didn't + invoke the display routines that perform bidi-display-reordering). If the character is composed, setup members of CMP_IT (id, nglyphs, from, to, reversed_p), and return true. Otherwise, update @@ -1256,7 +1258,16 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, else bpos = CHAR_TO_BYTE (cpos); } - if ((bidi_level & 1) == 0) + /* The bidi_level < 0 case below strictly speaking should + never happen, since we get here when bidi scan direction + is backward in the buffer, which can only happen if the + display routines were called to perform the bidi + reordering. But it doesn't harm to test for that, and + avoid someon raising their brows and thinking it's a + subtle bug... */ + if (bidi_level < 0) + direction = Qnil; + else if ((bidi_level & 1) == 0) direction = QL2R; else direction = QR2L; |