From ff94e32cb3462a95578be0f3be44f5749d0e0b1f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 25 Aug 2010 09:54:05 +0900 Subject: [PATCH] Fix finding a stop position for composition. --- src/ChangeLog | 6 ++++++ src/composite.c | 10 ++++++++++ 2 files changed, 16 insertions(+) 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) { -- 2.39.2