diff options
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, | |||
| 1171 | character to check, and CHARPOS and BYTEPOS are indices in the | 1171 | character to check, and CHARPOS and BYTEPOS are indices in the |
| 1172 | string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi | 1172 | string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi |
| 1173 | embedding level of the current paragraph, and is used to calculate the | 1173 | embedding level of the current paragraph, and is used to calculate the |
| 1174 | direction argument to pass to the font shaper. | 1174 | direction argument to pass to the font shaper; value of -1 means the |
| 1175 | caller doesn't know the embedding level (used by callers which didn't | ||
| 1176 | invoke the display routines that perform bidi-display-reordering). | ||
| 1175 | 1177 | ||
| 1176 | If the character is composed, setup members of CMP_IT (id, nglyphs, | 1178 | If the character is composed, setup members of CMP_IT (id, nglyphs, |
| 1177 | from, to, reversed_p), and return true. Otherwise, update | 1179 | from, to, reversed_p), and return true. Otherwise, update |
| @@ -1256,7 +1258,16 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, | |||
| 1256 | else | 1258 | else |
| 1257 | bpos = CHAR_TO_BYTE (cpos); | 1259 | bpos = CHAR_TO_BYTE (cpos); |
| 1258 | } | 1260 | } |
| 1259 | if ((bidi_level & 1) == 0) | 1261 | /* The bidi_level < 0 case below strictly speaking should |
| 1262 | never happen, since we get here when bidi scan direction | ||
| 1263 | is backward in the buffer, which can only happen if the | ||
| 1264 | display routines were called to perform the bidi | ||
| 1265 | reordering. But it doesn't harm to test for that, and | ||
| 1266 | avoid someon raising their brows and thinking it's a | ||
| 1267 | subtle bug... */ | ||
| 1268 | if (bidi_level < 0) | ||
| 1269 | direction = Qnil; | ||
| 1270 | else if ((bidi_level & 1) == 0) | ||
| 1260 | direction = QL2R; | 1271 | direction = QL2R; |
| 1261 | else | 1272 | else |
| 1262 | direction = QR2L; | 1273 | direction = QR2L; |