emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105374: Fix last change for bug#9212


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105374: Fix last change for bug#9212.
Date: Mon, 01 Aug 2011 20:59:35 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105374
fixes bug(s): http://debbugs.gnu.org/9212
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2011-08-01 20:59:35 +0300
message:
  Fix last change for bug#9212.
modified:
  src/xdisp.c
=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2011-08-01 17:34:04 +0000
+++ b/src/xdisp.c       2011-08-01 17:59:35 +0000
@@ -5730,29 +5730,36 @@
        {
          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);
        }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]