]> code.delx.au - gnu-emacs/commitdiff
Fix vertical-movement in buffers with wrap-prefix
authorEli Zaretskii <eliz@gnu.org>
Sat, 2 Jul 2016 12:39:26 +0000 (15:39 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 2 Jul 2016 12:39:26 +0000 (15:39 +0300)
* src/indent.c (Fvertical_motion): Zero the current_y coordinate
whenever we zero the vpos vertical position of the iterator.
* src/xdisp.c (move_it_in_display_line_to): Handle line-prefix and
wrap-prefix regardless of whether the current Y coordinate is
inside the window dimensions.  (Bug#23879)

src/indent.c
src/xdisp.c

index 5d7c6ae4f9834abda7ff3a77472829c103a52a9a..bc59239f20fb8b37e03fda75a265a4af3959cba3 100644 (file)
@@ -2178,6 +2178,7 @@ whether or not it is currently displayed in some window.  */)
       if (nlines <= 0)
        {
          it.vpos = vpos_init;
+         it.current_y = 0;
          /* Do this even if LINES is 0, so that we move back to the
             beginning of the current line as we ought.  */
          if ((nlines < 0 && IT_CHARPOS (it) > 0)
@@ -2187,6 +2188,7 @@ whether or not it is currently displayed in some window.  */)
       else if (overshoot_handled)
        {
          it.vpos = vpos_init;
+         it.current_y = 0;
          move_it_by_lines (&it, min (PTRDIFF_MAX, nlines));
        }
       else
@@ -2200,6 +2202,7 @@ whether or not it is currently displayed in some window.  */)
              while (IT_CHARPOS (it) <= it_start)
                {
                  it.vpos = 0;
+                 it.current_y = 0;
                  move_it_by_lines (&it, 1);
                }
              if (nlines > 1)
@@ -2208,6 +2211,7 @@ whether or not it is currently displayed in some window.  */)
          else  /* it_start = ZV */
            {
              it.vpos = 0;
+             it.current_y = 0;
              move_it_by_lines (&it, min (PTRDIFF_MAX, nlines));
              /* We could have some display or overlay string at ZV,
                 in which case it.vpos will be nonzero now, while
index 2d0d67784cc057854c2222cbe76091a9f09396c2..d05eca169c33294bd9f14a1b100e48ad9f114194 100644 (file)
@@ -8609,8 +8609,7 @@ move_it_in_display_line_to (struct it *it,
           && it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
 
   /* If there's a line-/wrap-prefix, handle it.  */
-  if (it->hpos == 0 && it->method == GET_FROM_BUFFER
-      && it->current_y < it->last_visible_y)
+  if (it->hpos == 0 && it->method == GET_FROM_BUFFER)
     handle_line_prefix (it);
 
   if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))