aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c9
1 files changed, 6 insertions, 3 deletions
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,
13436 the user limited scrolling by a small number of lines, but 13436 the user limited scrolling by a small number of lines, but
13437 always finds PT if scroll_conservatively is set to a large 13437 always finds PT if scroll_conservatively is set to a large
13438 number, such as most-positive-fixnum. */ 13438 number, such as most-positive-fixnum. */
13439 int slack = min (scroll_max, 10 * FRAME_LINE_HEIGHT (f)); 13439 int slack = max (scroll_max, 10 * FRAME_LINE_HEIGHT (f));
13440 int y_to_move =
13441 slack >= INT_MAX - it.last_visible_y
13442 ? INT_MAX
13443 : it.last_visible_y + slack;
13440 13444
13441 /* Compute the distance from the scroll margin to PT or to 13445 /* Compute the distance from the scroll margin to PT or to
13442 the scroll limit, whichever comes first. This should 13446 the scroll limit, whichever comes first. This should
13443 include the height of the cursor line, to make that line 13447 include the height of the cursor line, to make that line
13444 fully visible. */ 13448 fully visible. */
13445 move_it_to (&it, PT, -1, 13449 move_it_to (&it, PT, -1, y_to_move,
13446 it.last_visible_y + slack,
13447 -1, MOVE_TO_POS | MOVE_TO_Y); 13450 -1, MOVE_TO_POS | MOVE_TO_Y);
13448 dy = line_bottom_y (&it) - y0; 13451 dy = line_bottom_y (&it) - y0;
13449 13452