/* Return 1 iff a character at CHARPOS (and BYTEPOS) is composed
(possibly with the following characters). */
-#define CHAR_COMPOSED_P(IT,CHARPOS,BYTEPOS) \
+#define CHAR_COMPOSED_P(IT,CHARPOS,BYTEPOS,END_CHARPOS) \
((IT)->cmp_it.id >= 0 \
|| ((IT)->cmp_it.stop_pos == (CHARPOS) \
&& composition_reseat_it (&(IT)->cmp_it, CHARPOS, BYTEPOS, \
- (IT)->end_charpos, (IT)->w, \
+ END_CHARPOS, (IT)->w, \
FACE_FROM_ID ((IT)->f, (IT)->face_id), \
(IT)->string)))
return 0;
}
else if (CHAR_COMPOSED_P (it, IT_STRING_CHARPOS (*it),
- IT_STRING_BYTEPOS (*it))
+ IT_STRING_BYTEPOS (*it), SCHARS (it->string))
&& next_element_from_composition (it))
{
return 1;
CHARPOS (position) = BYTEPOS (position) = -1;
}
else if (CHAR_COMPOSED_P (it, IT_STRING_CHARPOS (*it),
- IT_STRING_BYTEPOS (*it))
+ IT_STRING_BYTEPOS (*it), it->string_nchars)
&& next_element_from_composition (it))
{
return 1;
&& IT_CHARPOS (*it) >= it->redisplay_end_trigger_charpos)
run_redisplay_end_trigger_hook (it);
- if (CHAR_COMPOSED_P (it, IT_CHARPOS (*it), IT_BYTEPOS (*it))
+ if (CHAR_COMPOSED_P (it, IT_CHARPOS (*it), IT_BYTEPOS (*it),
+ it->end_charpos)
&& next_element_from_composition (it))
{
return 1;