summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2010-04-23 21:10:31 +0300
committerEli Zaretskii <eliz@gnu.org>2010-04-23 21:10:31 +0300
commitb893a1502db32da5d0d0e26a90b5d26d2ee4ee04 (patch)
tree7375146735e09b75c37c269a76258881316de5b2
parent8785b8887a35e22970b65409de0738302b91c982 (diff)
downloademacs-b893a1502db32da5d0d0e26a90b5d26d2ee4ee04.tar.gz
Fix display of composed characters from L2R scripts in bidi buffers.
xdisp.c (set_iterator_to_next, next_element_from_composition): After advancing IT past the composition, resync the bidi iterator with IT's position. (Bug#5977)
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c20
2 files changed, 22 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 25f5a2af42a..f5f6e8c4421 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,6 +3,9 @@
* xdisp.c (pop_it): When the stack is popped after displaying
from a string, bidi-iterate to exit from the text portion covered
by the `display' property or overlay. (Bug#5988, bug#5920)
+ (set_iterator_to_next, next_element_from_composition): Fix display
+ of composed characters from L2R scripts in bidi buffers.
+ (Bug#5977)
2010-04-23 Dan Nicolaescu <dann@ics.uci.edu>
diff --git a/src/xdisp.c b/src/xdisp.c
index e68c4f6f292..753ea16db01 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5309,7 +5309,7 @@ pop_it (it)
determine the paragraph base direction if the overlay we
just processed is at the beginning of a new
paragraph. */
- if (it->bidi_it.first_elt)
+ if (it->bidi_it.first_elt && it->bidi_it.charpos < ZV)
bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
/* prev_stop can be zero, so check against BEGV as well. */
while (it->bidi_it.charpos >= BEGV
@@ -6274,6 +6274,15 @@ set_iterator_to_next (it, reseat_p)
{
IT_CHARPOS (*it) += it->cmp_it.nchars;
IT_BYTEPOS (*it) += it->cmp_it.nbytes;
+ if (it->bidi_p)
+ {
+ if (it->bidi_it.new_paragraph)
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ /* Resync the bidi iterator with IT's new position.
+ FIXME: this doesn't support bidirectional text. */
+ while (it->bidi_it.charpos < IT_CHARPOS (*it))
+ bidi_get_next_char_visually (&it->bidi_it);
+ }
if (it->cmp_it.to < it->cmp_it.nglyphs)
it->cmp_it.from = it->cmp_it.to;
else
@@ -6995,6 +7004,15 @@ next_element_from_composition (it)
{
IT_CHARPOS (*it) += it->cmp_it.nchars;
IT_BYTEPOS (*it) += it->cmp_it.nbytes;
+ if (it->bidi_p)
+ {
+ if (it->bidi_it.new_paragraph)
+ bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+ /* Resync the bidi iterator with IT's new position.
+ FIXME: this doesn't support bidirectional text. */
+ while (it->bidi_it.charpos < IT_CHARPOS (*it))
+ bidi_get_next_char_visually (&it->bidi_it);
+ }
return 0;
}
it->position = it->current.pos;