From b0e619b41a0cdd619b531d2f35135d83a872cbb4 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 13 Aug 2001 12:14:32 +0000 Subject: [PATCH] (move_it_by_lines) : If not already on a line start, move back to the line start. --- src/ChangeLog | 3 +++ src/xdisp.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 89a26e3a463..4aea39cc3b6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2001-08-13 Gerd Moellmann + * xdisp.c (move_it_by_lines) : 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. diff --git a/src/xdisp.c b/src/xdisp.c index 10e7abe1ddb..cb54fc178f5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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) -- 2.39.2