changeset 109972:7a86ccf3260e

Fix finding a stop position for composition.
author Kenichi Handa <handa@m17n.org>
date Wed, 25 Aug 2010 09:54:05 +0900
parents 637005c4c3ca
children 08e939f21918
files src/ChangeLog src/composite.c
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Aug 19 07:55:30 2010 +0200
+++ b/src/ChangeLog	Wed Aug 25 09:54:05 2010 +0900
@@ -1,3 +1,9 @@
+2010-08-25  Kenichi Handa  <handa@m17n.org>
+
+	* composite.c (composition_compute_stop_pos): In forward search,
+	pay attention to the possibility that some character after ENDPOS
+	will be composed with charactrs before ENDPOS.
+
 2010-08-19  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary".
--- a/src/composite.c	Thu Aug 19 07:55:30 2010 +0200
+++ b/src/composite.c	Wed Aug 25 09:54:05 2010 +0900
@@ -1091,6 +1091,16 @@
 		}
 	    }
 	}
+      if (charpos == endpos)
+	{
+	  /* We couldn't find a composition point before ENDPOS.  But,
+	     some character after ENDPOS may be composed with
+	     characters before ENDPOS.  So, we should stop at the safe
+	     point.  */
+	  charpos = endpos - MAX_AUTO_COMPOSITION_LOOKBACK;
+	  if (charpos < start)
+	    charpos = start;
+	}
     }
   else if (charpos > endpos)
     {