changeset 109025:aeb7617bd322

xdisp.c (try_scrolling): Fix last change.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 19 Jun 2010 14:57:19 +0300
parents f24aeaefbe37
children c138aa96dae8 cf1662d15309
files src/xdisp.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sat Jun 19 12:40:15 2010 +0300
+++ b/src/xdisp.c	Sat Jun 19 14:57:19 2010 +0300
@@ -13436,14 +13436,17 @@
 	     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;