comparison src/xdisp.c @ 108079:216b6ef76da7

Support `display' text properties and overlays. xdisp.c (pop_it): When the stack is popped after displaying from a string, bidi-iterate to exit from the text portion covered by the `display' property or overlay. (Bug#5988, bug#5920)
author Eli Zaretskii <eliz@gnu.org>
date Fri, 23 Apr 2010 18:05:23 +0300
parents 4d8277a44bb4
children 33a95d8ffa43 d9c182b86800
comparison
equal deleted inserted replaced
108075:a39e96e3b891 108079:216b6ef76da7
5297 case GET_FROM_STRETCH: 5297 case GET_FROM_STRETCH:
5298 it->object = p->u.comp.object; 5298 it->object = p->u.comp.object;
5299 break; 5299 break;
5300 case GET_FROM_BUFFER: 5300 case GET_FROM_BUFFER:
5301 it->object = it->w->buffer; 5301 it->object = it->w->buffer;
5302 if (it->bidi_p)
5303 {
5304 /* Bidi-iterate until we get out of the portion of text, if
5305 any, covered by a `display' text property or an overlay
5306 with `display' property. (We cannot just jump there,
5307 because the internal coherency of the bidi iterator state
5308 can not be preserved across such jumps.) We also must
5309 determine the paragraph base direction if the overlay we
5310 just processed is at the beginning of a new
5311 paragraph. */
5312 if (it->bidi_it.first_elt)
5313 bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
5314 /* prev_stop can be zero, so check against BEGV as well. */
5315 while (it->bidi_it.charpos >= BEGV
5316 && it->prev_stop <= it->bidi_it.charpos
5317 && it->bidi_it.charpos < CHARPOS (it->position))
5318 bidi_get_next_char_visually (&it->bidi_it);
5319 /* Record the stop_pos we just crossed, for when we cross it
5320 back, maybe. */
5321 if (it->bidi_it.charpos > CHARPOS (it->position))
5322 it->prev_stop = CHARPOS (it->position);
5323 /* If we ended up not where pop_it put us, resync IT's
5324 positional members with the bidi iterator. */
5325 if (it->bidi_it.charpos != CHARPOS (it->position))
5326 {
5327 SET_TEXT_POS (it->position,
5328 it->bidi_it.charpos, it->bidi_it.bytepos);
5329 it->current.pos = it->position;
5330 }
5331 }
5302 break; 5332 break;
5303 case GET_FROM_STRING: 5333 case GET_FROM_STRING:
5304 it->object = it->string; 5334 it->object = it->string;
5305 break; 5335 break;
5306 case GET_FROM_DISPLAY_VECTOR: 5336 case GET_FROM_DISPLAY_VECTOR: