(move_it_by_lines) <DVPOS < 0>: If not already on
authorGerd Moellmann <gerd@gnu.org>
Mon, 13 Aug 2001 12:14:32 +0000 (12:14 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 13 Aug 2001 12:14:32 +0000 (12:14 +0000)
a line start, move back to the line start.

src/ChangeLog
src/xdisp.c

index 89a26e3..4aea39c 100644 (file)
@@ -1,5 +1,8 @@
 2001-08-13  Gerd Moellmann  <gerd@gnu.org>
 
+       * xdisp.c (move_it_by_lines) <DVPOS < 0>: If not already on
+       a line start, move back to the line start.
+       
        * xdisp.c (resize_echo_area_exactly): Don't resize the mini-window
        exactly when a mini-buffer is active.
 
index 10e7abe..cb54fc1 100644 (file)
@@ -5477,6 +5477,12 @@ move_it_by_lines (it, dvpos, need_y_p)
       struct it it2;
       int start_charpos, i;
       
+      /* If we start in the middle of a line, move to the beginning
+        of that line first.  */
+      if (IT_CHARPOS (*it) > BEGV
+         && FETCH_BYTE (IT_BYTEPOS (*it) - 1) != '\n')
+       back_to_previous_visible_line_start (it);
+      
       /* Go back -DVPOS visible lines and reseat the iterator there.  */
       start_charpos = IT_CHARPOS (*it);
       for (i = -dvpos; i && IT_CHARPOS (*it) > BEGV; --i)