+2011-12-23 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (handle_invisible_prop): Handle correctly an invisible
+ property that ends at ZV, so that the bidi iteration could be
+ resumed from there (after widening).
+
2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
while (invis_p);
/* The position newpos is now either ZV or on visible text. */
- if (it->bidi_p && newpos < ZV)
+ if (it->bidi_p)
{
EMACS_INT bpos = CHAR_TO_BYTE (newpos);
- int on_newline = FETCH_BYTE (bpos) == '\n';
+ int on_newline =
+ bpos == ZV_BYTE || FETCH_BYTE (bpos) == '\n';
int after_newline =
newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
SET_TEXT_POS (tpos, newpos, bpos);
reseat_1 (it, tpos, 0);
- /* If we reseat on a newline, we need to prep the
+ /* If we reseat on a newline/ZV, we need to prep the
bidi iterator for advancing to the next character
- after the newline, keeping the current paragraph
+ after the newline/EOB, keeping the current paragraph
direction (so that PRODUCE_GLYPHS does TRT wrt
prepending/appending glyphs to a glyph row). */
if (on_newline)
{
it->bidi_it.first_elt = 0;
it->bidi_it.paragraph_dir = pdir;
- it->bidi_it.ch = '\n';
+ it->bidi_it.ch = (bpos == ZV_BYTE) ? -1 : '\n';
it->bidi_it.nchars = 1;
it->bidi_it.ch_len = 1;
}