From: Gerd Moellmann Date: Mon, 13 Aug 2001 12:14:32 +0000 (+0000) Subject: (move_it_by_lines) : If not already on X-Git-Tag: emacs-pretest-21.0.105~196 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b0e619b41a0cdd619b531d2f35135d83a872cbb4;p=emacs.git (move_it_by_lines) : If not already on a line start, move back to the line start. --- 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)