From: Eli Zaretskii Date: Mon, 1 Aug 2011 17:59:35 +0000 (+0300) Subject: Fix last change for bug#9212. X-Git-Tag: emacs-pretest-24.0.90~104^2~124^2~66^2~24 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ffc21858b7a5d321975dd1673bb94d16a6032bae;p=emacs.git Fix last change for bug#9212. --- diff --git a/src/xdisp.c b/src/xdisp.c index a17d200c827..9d3e501787b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5730,29 +5730,36 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p) { if (IT_STRING_CHARPOS (*it) > 0) { - --IT_STRING_CHARPOS (*it); - --IT_STRING_BYTEPOS (*it); - if (it->bidi_p) + if (!it->bidi_p) + { + --IT_STRING_CHARPOS (*it); + --IT_STRING_BYTEPOS (*it); + } + else { /* We need to restore the bidi iterator to the state - it had on the newline. */ + it had on the newline, and resync the IT's + position with that. */ it->bidi_it = bidi_it_prev; - xassert (IT_STRING_CHARPOS (*it) == it->bidi_it.charpos - && IT_STRING_BYTEPOS (*it) == it->bidi_it.bytepos); + IT_STRING_CHARPOS (*it) = it->bidi_it.charpos; + IT_STRING_BYTEPOS (*it) = it->bidi_it.bytepos; } } } else if (IT_CHARPOS (*it) > BEGV) { - --IT_CHARPOS (*it); - --IT_BYTEPOS (*it); - if (it->bidi_p) + if (!it->bidi_p) + { + --IT_CHARPOS (*it); + --IT_BYTEPOS (*it); + } + else { /* We need to restore the bidi iterator to the state it - had on the newline. */ + had on the newline and resync IT with that. */ it->bidi_it = bidi_it_prev; - xassert (IT_CHARPOS (*it) == it->bidi_it.charpos - && IT_BYTEPOS (*it) == it->bidi_it.bytepos); + IT_CHARPOS (*it) = it->bidi_it.charpos; + IT_BYTEPOS (*it) = it->bidi_it.bytepos; } reseat (it, it->current.pos, 0); }