From e89aaabdcb8f815c65ac67987670e054088c701d Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Mon, 5 Feb 2001 13:02:51 +0000 Subject: [PATCH] (try_scrolling): If point is in the line below the window, make sure to move the iterator at least a canonical char height down. --- src/ChangeLog | 4 ++++ src/xdisp.c | 16 ++++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 385a98fe1be..f43f38997cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2001-02-05 Gerd Moellmann + * xdisp.c (try_scrolling): If point is in the line below the + window, make sure to move the iterator at least a canonical + char height down. + * window.c (Fmove_to_window_line): Don't add 1 if window is vscrolled. diff --git a/src/xdisp.c b/src/xdisp.c index eaaff196079..94e3f41b14c 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9005,9 +9005,6 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, if (PT >= CHARPOS (scroll_margin_pos)) { int y0; -#if 0 - int line_height; -#endif /* Point is in the scroll margin at the bottom of the window, or below. Compute a new window start that makes point visible. */ @@ -9018,19 +9015,13 @@ 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); -#if 0 /* Taking the line's height into account here looks wrong. */ - line_height = (it.max_ascent + it.max_descent - ? it.max_ascent + it.max_descent - : last_height); - dy = it.current_y + line_height - y0; -#else + /* 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; -#endif if (dy > scroll_max) return 0; @@ -9041,8 +9032,9 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, start_display (&it, w, startp); if (scroll_conservatively) - amount_to_scroll = - max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); + amount_to_scroll + = max (max (dy, CANON_Y_UNIT (f)), + CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step)); else if (scroll_step || temp_scroll_step) amount_to_scroll = scroll_max; else -- 2.39.5