summaryrefslogtreecommitdiff
path: root/src/composite.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2000-12-30 02:29:22 +0000
committerKenichi Handa <handa@m17n.org>2000-12-30 02:29:22 +0000
commitd279f62098be26a9e5ae55d02844d2e708e29e66 (patch)
treeef6be0893b21ee5b83c935c30811f3196bc0c46e /src/composite.c
parentabb1acc440e57cc30cbb5b651945761116cb9344 (diff)
downloademacs-d279f62098be26a9e5ae55d02844d2e708e29e66.tar.gz
(find_composition): Fix a code for searching a composition backward.
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/composite.c b/src/composite.c
index 2ffc33d651e..83d5b0d6f25 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -422,14 +422,25 @@ find_composition (pos, limit, start, end, prop, object)
return 0;
if (limit > pos) /* search forward */
- val = Fnext_single_property_change (make_number (pos), Qcomposition,
- object, make_number (limit));
+ {
+ val = Fnext_single_property_change (make_number (pos), Qcomposition,
+ object, make_number (limit));
+ pos = XINT (val);
+ if (pos == limit)
+ return 0;
+ }
else /* search backward */
- val = Fprevious_single_property_change (make_number (pos), Qcomposition,
- object, make_number (limit));
- pos = XINT (val);
- if (pos == limit)
- return 0;
+ {
+ if (get_property_and_range (pos - 1, Qcomposition, prop, start, end,
+ object))
+ return 1;
+ val = Fprevious_single_property_change (make_number (pos), Qcomposition,
+ object, make_number (limit));
+ pos = XINT (val);
+ if (pos == limit)
+ return 0;
+ pos--;
+ }
get_property_and_range (pos, Qcomposition, prop, start, end, object);
return 1;
}