Commit d048e1e6 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Fix assertion violation in pop_it when org-indent-mode is used.

 src/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).
parent bffcee0a
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> 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
* nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc. * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
......
...@@ -4090,10 +4090,11 @@ handle_invisible_prop (struct it *it) ...@@ -4090,10 +4090,11 @@ handle_invisible_prop (struct it *it)
while (invis_p); while (invis_p);
   
/* The position newpos is now either ZV or on visible text. */ /* 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); 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 = int after_newline =
newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n'; newpos <= BEGV || FETCH_BYTE (bpos - 1) == '\n';
   
...@@ -4111,16 +4112,16 @@ handle_invisible_prop (struct it *it) ...@@ -4111,16 +4112,16 @@ handle_invisible_prop (struct it *it)
   
SET_TEXT_POS (tpos, newpos, bpos); SET_TEXT_POS (tpos, newpos, bpos);
reseat_1 (it, tpos, 0); 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 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 direction (so that PRODUCE_GLYPHS does TRT wrt
prepending/appending glyphs to a glyph row). */ prepending/appending glyphs to a glyph row). */
if (on_newline) if (on_newline)
{ {
it->bidi_it.first_elt = 0; it->bidi_it.first_elt = 0;
it->bidi_it.paragraph_dir = pdir; 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.nchars = 1;
it->bidi_it.ch_len = 1; it->bidi_it.ch_len = 1;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment