]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix finding a stop position for composition.
authorKenichi Handa <handa@m17n.org>
Wed, 25 Aug 2010 00:54:05 +0000 (09:54 +0900)
committerKenichi Handa <handa@m17n.org>
Wed, 25 Aug 2010 00:54:05 +0000 (09:54 +0900)
src/ChangeLog
src/composite.c

index 0a1a268d9624dbb5c3631f000e950a8b0e17c1b0..7fb542eab33572f94fe433a7488a70d299faa91c 100644 (file)
@@ -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".
index 392da1ceba15f4cb0040f7eb2497d49c6024edbd..3b128853c10d34c132cad57f26a520185937e82b 100644 (file)
@@ -1091,6 +1091,16 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
                }
            }
        }
+      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)
     {