diff src/xdisp.c @ 108089:2bdfb77de643

Fix display of composed characters from L2R scripts in bidi buffers. (Bug#5977) xdisp.c (set_iterator_to_next, next_element_from_composition): After advancing IT past the composition, resync the bidi iterator with IT's position.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 23 Apr 2010 21:23:51 +0300
parents 33a95d8ffa43 d9c182b86800
children 01ca94871a56
line wrap: on
line diff
--- a/src/xdisp.c	Fri Apr 23 20:48:22 2010 +0300
+++ b/src/xdisp.c	Fri Apr 23 21:23:51 2010 +0300
@@ -6274,6 +6274,15 @@
 	{
 	  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 @@
 	{
 	  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;