From: Gerd Moellmann Date: Fri, 28 Dec 2001 12:42:54 +0000 (+0000) Subject: (try_scrolling) : Add the X-Git-Tag: ttn-vms-21-2-B4~17446 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=539e92ad44425c488f308b3ed647879131a6302d;p=emacs.git (try_scrolling) : Add the height of the cursor line to the amount to scroll. --- diff --git a/src/ChangeLog b/src/ChangeLog index 7a69d4500fb..6cbd7d57042 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-28 Gerd Moellmann + + * xdisp.c (try_scrolling) : Add the + height of the cursor line to the amount to scroll. + 2001-12-27 Richard M. Stallman * intervals.c (set_point_both): The position after an invisible, diff --git a/src/xdisp.c b/src/xdisp.c index f64e3eeabf5..0d25501e1a1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9534,13 +9534,11 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, y0 = it.current_y; move_it_to (&it, PT, 0, it.last_visible_y, -1, MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); - - /* With a scroll_margin of 0, scroll_margin_pos is at the window - end, which is one line below the window. The iterator's - current_y will be same as y0 in that case, but we have to - scroll a line to make PT visible. That's the reason why 1 is - added below. */ - dy = 1 + it.current_y - y0; + + /* To make point visible, we have to move the window start + down so that the line the cursor is in is visible, which + means we have to add in the height of the cursor line. */ + dy = line_bottom_y (&it) - y0; if (dy > scroll_max) return SCROLLING_FAILED;