From: Eli Zaretskii Date: Sat, 19 Jun 2010 11:57:19 +0000 (+0300) Subject: xdisp.c (try_scrolling): Fix last change. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~51^2~139 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d4aaac0f37d3e6e386c826575be8294a7dd4d2a3;p=emacs.git xdisp.c (try_scrolling): Fix last change. --- diff --git a/src/xdisp.c b/src/xdisp.c index c111ca2ffa3..d533346c3b6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13436,14 +13436,17 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, the user limited scrolling by a small number of lines, but always finds PT if scroll_conservatively is set to a large number, such as most-positive-fixnum. */ - int slack = min (scroll_max, 10 * FRAME_LINE_HEIGHT (f)); + int slack = max (scroll_max, 10 * FRAME_LINE_HEIGHT (f)); + int y_to_move = + slack >= INT_MAX - it.last_visible_y + ? INT_MAX + : it.last_visible_y + slack; /* Compute the distance from the scroll margin to PT or to the scroll limit, whichever comes first. This should include the height of the cursor line, to make that line fully visible. */ - move_it_to (&it, PT, -1, - it.last_visible_y + slack, + move_it_to (&it, PT, -1, y_to_move, -1, MOVE_TO_POS | MOVE_TO_Y); dy = line_bottom_y (&it) - y0;