emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107714: Fix bug #11063 with move_it_


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107714: Fix bug #11063 with move_it_by_lines when there's a before-string at bol.
Date: Sat, 31 Mar 2012 22:30:53 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107714
fixes bug(s): http://debbugs.gnu.org/11063
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2012-03-31 22:30:53 +0300
message:
  Fix bug #11063 with move_it_by_lines when there's a before-string at bol.
  
   src/xdisp.c (move_it_by_lines): When DVPOS is positive, and the
   position we get to after a call to move_it_to fails the
   IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
   only if we wind up in a string from display property.
modified:
  src/ChangeLog
  src/xdisp.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-03-31 18:10:34 +0000
+++ b/src/ChangeLog     2012-03-31 19:30:53 +0000
@@ -1,5 +1,10 @@
 2012-03-31  Eli Zaretskii  <address@hidden>
 
+       * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
+       position we get to after a call to move_it_to fails the
+       IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
+       only if we wind up in a string from display property.  (Bug#11063)
+
        * window.c (Fdelete_other_windows_internal): Invalidate the row
        and column information about mouse highlight, so that redisplay
        restores it after reallocating the glyph matrices.  (Bug#7464)

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2012-03-31 17:08:38 +0000
+++ b/src/xdisp.c       2012-03-31 19:30:53 +0000
@@ -8973,7 +8973,20 @@
     {
       move_it_to (it, -1, -1, -1, it->vpos + dvpos, MOVE_TO_VPOS);
       if (!IT_POS_VALID_AFTER_MOVE_P (it))
-       move_it_to (it, IT_CHARPOS (*it) + 1, -1, -1, -1, MOVE_TO_POS);
+       {
+         /* Only move to the next buffer position if we ended up in a
+            string from display property, not in an overlay string
+            (before-string or after-string).  That is because the
+            latter don't conceal the underlying buffer position, so
+            we can ask to move the iterator to the exact position we
+            are interested in.  Note that, even if we are already at
+            IT_CHARPOS (*it), the call below is not a no-op, as it
+            will detect that we are at the end of the string, pop the
+            iterator, and compute it->current_x and it->hpos
+            correctly.  */
+         move_it_to (it, IT_CHARPOS (*it) + it->string_from_display_prop_p,
+                     -1, -1, -1, MOVE_TO_POS);
+       }
     }
   else
     {


reply via email to

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