changeset 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 076e73b014a5 (current diff) d9c182b86800 (diff)
children b8f821937636
files src/ChangeLog src/xdisp.c
diffstat 2 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Apr 23 20:48:22 2010 +0300
+++ b/src/ChangeLog	Fri Apr 23 21:23:51 2010 +0300
@@ -1,3 +1,10 @@
+2010-04-23  Eli Zaretskii  <eliz@gnu.org>
+
+	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)
+
 2010-04-23  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* Makefile.in (LD_SWITCH_MACHINE_TEMACS): Remove, unused.
--- 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;