aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKhaled Hosny2019-01-05 22:54:48 +0200
committerKhaled Hosny2019-01-05 22:54:48 +0200
commit398ad62a4986e426aa665010b69319fec9203430 (patch)
treee0efeff2480076b8aadc95f6cd099c456179a4a5 /src
parentf7ccac9f9d82019d4d5ba3182200422fbc9c7e67 (diff)
downloademacs-398ad62a4986e426aa665010b69319fec9203430.tar.gz
emacs-398ad62a4986e426aa665010b69319fec9203430.zip
We need the bidi level not the paragraph direction
Diffstat (limited to 'src')
-rw-r--r--src/composite.c16
-rw-r--r--src/composite.h2
-rw-r--r--src/xdisp.c2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/composite.c b/src/composite.c
index 77bb79a0cfe..28501e47571 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -1167,8 +1167,8 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
1167 characters to be composed. FACE, if non-NULL, is a base face of 1167 characters to be composed. FACE, if non-NULL, is a base face of
1168 the character. If STRING is not nil, it is a string containing the 1168 the character. If STRING is not nil, it is a string containing the
1169 character to check, and CHARPOS and BYTEPOS are indices in the 1169 character to check, and CHARPOS and BYTEPOS are indices in the
1170 string. In that case, FACE must not be NULL. PDIR is the base 1170 string. In that case, FACE must not be NULL. BIDI_LEVEL is the bidi
1171 direction of the current paragraph, and is used to calculate the 1171 embedding level of the current paragraph, and is used to calculate the
1172 direction argument to pass to the font shaper. 1172 direction argument to pass to the font shaper.
1173 1173
1174 If the character is composed, setup members of CMP_IT (id, nglyphs, 1174 If the character is composed, setup members of CMP_IT (id, nglyphs,
@@ -1178,7 +1178,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
1178bool 1178bool
1179composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos, 1179composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
1180 ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w, 1180 ptrdiff_t bytepos, ptrdiff_t endpos, struct window *w,
1181 bidi_dir_t pdir, struct face *face, Lisp_Object string) 1181 signed char bidi_level, struct face *face, Lisp_Object string)
1182{ 1182{
1183 if (cmp_it->ch == -2) 1183 if (cmp_it->ch == -2)
1184 { 1184 {
@@ -1215,9 +1215,9 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
1215 continue; 1215 continue;
1216 if (charpos < endpos) 1216 if (charpos < endpos)
1217 { 1217 {
1218 if (pdir == L2R) 1218 if ((bidi_level & 1) == 0)
1219 direction = QL2R; 1219 direction = QL2R;
1220 else if (pdir == R2L) 1220 else
1221 direction = QR2L; 1221 direction = QR2L;
1222 for (; CONSP (val); val = XCDR (val)) 1222 for (; CONSP (val); val = XCDR (val))
1223 { 1223 {
@@ -1252,10 +1252,10 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
1252 else 1252 else
1253 bpos = CHAR_TO_BYTE (cpos); 1253 bpos = CHAR_TO_BYTE (cpos);
1254 } 1254 }
1255 if (pdir == L2R) 1255 if ((bidi_level & 1) == 0)
1256 direction = QR2L;
1257 else if (pdir == R2L)
1258 direction = QL2R; 1256 direction = QL2R;
1257 else
1258 direction = QR2L;
1259 lgstring = autocmp_chars (elt, cpos, bpos, charpos + 1, w, face, 1259 lgstring = autocmp_chars (elt, cpos, bpos, charpos + 1, w, face,
1260 string, direction); 1260 string, direction);
1261 if (! composition_gstring_p (lgstring) 1261 if (! composition_gstring_p (lgstring)
diff --git a/src/composite.h b/src/composite.h
index 44f7ab7f616..8ee18cd9eea 100644
--- a/src/composite.h
+++ b/src/composite.h
@@ -322,7 +322,7 @@ extern void composition_compute_stop_pos (struct composition_it *,
322 Lisp_Object); 322 Lisp_Object);
323extern bool composition_reseat_it (struct composition_it *, ptrdiff_t, 323extern bool composition_reseat_it (struct composition_it *, ptrdiff_t,
324 ptrdiff_t, ptrdiff_t, struct window *, 324 ptrdiff_t, ptrdiff_t, struct window *,
325 bidi_dir_t, struct face *, Lisp_Object); 325 signed char, struct face *, Lisp_Object);
326extern int composition_update_it (struct composition_it *, 326extern int composition_update_it (struct composition_it *,
327 ptrdiff_t, ptrdiff_t, Lisp_Object); 327 ptrdiff_t, ptrdiff_t, Lisp_Object);
328 328
diff --git a/src/xdisp.c b/src/xdisp.c
index 413d64f80c7..665ab2e583f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6906,7 +6906,7 @@ static next_element_function const get_next_element[NUM_IT_METHODS] =
6906 || ((IT)->cmp_it.stop_pos == (CHARPOS) \ 6906 || ((IT)->cmp_it.stop_pos == (CHARPOS) \
6907 && composition_reseat_it (&(IT)->cmp_it, CHARPOS, BYTEPOS, \ 6907 && composition_reseat_it (&(IT)->cmp_it, CHARPOS, BYTEPOS, \
6908 END_CHARPOS, (IT)->w, \ 6908 END_CHARPOS, (IT)->w, \
6909 (IT)->bidi_it.paragraph_dir, \ 6909 (IT)->bidi_it.resolved_level, \
6910 FACE_FROM_ID_OR_NULL ((IT)->f, \ 6910 FACE_FROM_ID_OR_NULL ((IT)->f, \
6911 (IT)->face_id), \ 6911 (IT)->face_id), \
6912 (IT)->string))) 6912 (IT)->string)))