Mercurial > emacs
comparison src/xdisp.c @ 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 | 9f55c53fc33a |
comparison
equal
deleted
inserted
replaced
109024:f24aeaefbe37 | 109025:aeb7617bd322 |
---|---|
13434 /* Compute how many pixels below window bottom to stop searching | 13434 /* Compute how many pixels below window bottom to stop searching |
13435 for PT. This avoids costly search for PT that is far away if | 13435 for PT. This avoids costly search for PT that is far away if |
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 |
13450 if (dy > scroll_max) | 13453 if (dy > scroll_max) |
13451 return SCROLLING_FAILED; | 13454 return SCROLLING_FAILED; |