prop = Fget_char_property (position, Qinvisible, ww);
/* This is just an estimate to give reasonable
performance; nothing should go wrong if it is too small. */
- XFASTINT (limit) = pos + 50;
- endpos
- = Fnext_single_property_change (position, Qinvisible,
+ limit = Fnext_overlay_change (position);
+ if (XFASTINT (limit) > pos + 50)
+ XFASTINT (limit) = pos + 50;
+ endpos = Fnext_single_property_change (position, Qinvisible,
Fcurrent_buffer (), limit);
if (INTEGERP (endpos))
next_invisible = XINT (endpos);