]> git.eshelyaron.com Git - emacs.git/commitdiff
Restore original behavior of move_it_in_display_line_to when !bidi_p.
authorEli Zaretskii <eliz@gnu.org>
Tue, 30 Mar 2010 19:16:49 +0000 (15:16 -0400)
committerEli Zaretskii <eliz@gnu.org>
Tue, 30 Mar 2010 19:16:49 +0000 (15:16 -0400)
 xdisp.c (BUFFER_POS_REACHED_P, move_it_in_display_line_to):
 Restore original behavior when the iterator is not bidi_p.

src/ChangeLog
src/xdisp.c

index 3048e901494775ce1b22ec94f2a18b751e98ca18..448b9f2835e50221ce5edb3d69f9a27ad38bc180 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (BUFFER_POS_REACHED_P, move_it_in_display_line_to):
+       Restore original behavior when the iterator is not bidi_p.
+
 2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * xdisp.c (syms_of_xdisp): Use intern_c_string instead of intern.
index 17a018b749369d3078e01d23cdedd682fefe48da..c8b4c2b9aa5caef3c45b4d0af18e9747e61fb09c 100644 (file)
@@ -6999,7 +6999,8 @@ move_it_in_display_line_to (struct it *it,
 #define BUFFER_POS_REACHED_P()                                 \
   ((op & MOVE_TO_POS) != 0                                     \
    && BUFFERP (it->object)                                     \
-   && IT_CHARPOS (*it) == to_charpos                           \
+   && (IT_CHARPOS (*it) == to_charpos                          \
+       || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos))      \
    && (it->method == GET_FROM_BUFFER                           \
        || (it->method == GET_FROM_DISPLAY_VECTOR               \
           && it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
@@ -7023,14 +7024,16 @@ move_it_in_display_line_to (struct it *it,
       if ((op & MOVE_TO_POS) != 0
          && BUFFERP (it->object)
          && it->method == GET_FROM_BUFFER
-         && (prev_method == GET_FROM_IMAGE
-             || prev_method == GET_FROM_STRETCH)
-         /* Passed TO_CHARPOS from left to right.  */
-         && ((prev_pos < to_charpos
-              && IT_CHARPOS (*it) > to_charpos)
-             /* Passed TO_CHARPOS from right to left.  */
-             || (prev_pos > to_charpos)
-                 && IT_CHARPOS (*it) < to_charpos))
+         && ((!it->bidi_p && IT_CHARPOS (*it) > to_charpos)
+             || (it->bidi_p
+                 && (prev_method == GET_FROM_IMAGE
+                     || prev_method == GET_FROM_STRETCH)
+                 /* Passed TO_CHARPOS from left to right.  */
+                 && ((prev_pos < to_charpos
+                      && IT_CHARPOS (*it) > to_charpos)
+                     /* Passed TO_CHARPOS from right to left.  */
+                     || (prev_pos > to_charpos
+                         && IT_CHARPOS (*it) < to_charpos)))))
        {
          if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0)
            {