changeset 38800:9c6ef0fd5c4d

(move_it_by_lines) <DVPOS < 0>: If not already on a line start, move back to the line start.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 13 Aug 2001 12:14:15 +0000
parents d4a3eb49c20c
children 7784d99b4ecc
files src/xdisp.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Mon Aug 13 10:45:57 2001 +0000
+++ b/src/xdisp.c	Mon Aug 13 12:14:15 2001 +0000
@@ -5477,6 +5477,12 @@
       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)