From: Kenichi Handa Date: Wed, 25 Aug 2010 00:54:05 +0000 (+0900) Subject: Fix finding a stop position for composition. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~48^2~240^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ff94e32cb3462a95578be0f3be44f5749d0e0b1f;p=emacs.git Fix finding a stop position for composition. --- diff --git a/src/ChangeLog b/src/ChangeLog index 0a1a268d962..7fb542eab33 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2010-08-25 Kenichi Handa + + * 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 * nsselect.m (nxatoms_of_nsselect): Use "Selection" and "Secondary". diff --git a/src/composite.c b/src/composite.c index 392da1ceba1..3b128853c10 100644 --- a/src/composite.c +++ b/src/composite.c @@ -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) {