diff options
| author | Eli Zaretskii | 2010-06-20 21:04:30 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-06-20 21:04:30 +0300 |
| commit | 70c4cfbb3b0400b895b9520444908441551c7ef0 (patch) | |
| tree | df95303514e2469e6841e57bfc01e791df23f279 /src | |
| parent | 8adb4c33da6fb4c3dfeb664152b0076e6d62fef8 (diff) | |
| download | emacs-70c4cfbb3b0400b895b9520444908441551c7ef0.tar.gz emacs-70c4cfbb3b0400b895b9520444908441551c7ef0.zip | |
Avoid recentering when lines differ in their height.
xdisp.c (try_scrolling): When scroll-conservatively is set to
most-positive-fixnum, be extra accurate when scrolling window
start, to avoid missing the cursor line.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/xdisp.c | 21 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 7d875bf5bda..7405d92e0e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-06-20 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (try_scrolling): When scroll-conservatively is set to | ||
| 4 | most-positive-fixnum, be extra accurate when scrolling window | ||
| 5 | start, to avoid missing the cursor line. | ||
| 6 | |||
| 1 | 2010-06-19 Eli Zaretskii <eliz@gnu.org> | 7 | 2010-06-19 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * xdisp.c (try_scrolling): Compute the limit for searching point | 9 | * xdisp.c (try_scrolling): Compute the limit for searching point |
diff --git a/src/xdisp.c b/src/xdisp.c index d533346c3b6..795e13e6f1a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13486,7 +13486,26 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 13486 | return SCROLLING_FAILED; | 13486 | return SCROLLING_FAILED; |
| 13487 | 13487 | ||
| 13488 | start_display (&it, w, startp); | 13488 | start_display (&it, w, startp); |
| 13489 | move_it_vertically (&it, amount_to_scroll); | 13489 | if (scroll_max < INT_MAX) |
| 13490 | move_it_vertically (&it, amount_to_scroll); | ||
| 13491 | else | ||
| 13492 | { | ||
| 13493 | /* Extra precision for users who set scroll-conservatively | ||
| 13494 | to most-positive-fixnum: make sure the amount we scroll | ||
| 13495 | the window start is never less than amount_to_scroll, | ||
| 13496 | which was computed as distance from window bottom to | ||
| 13497 | point. This matters when lines at window top and lines | ||
| 13498 | below window bottom have different height. */ | ||
| 13499 | struct it it1 = it; | ||
| 13500 | /* We use a temporary it1 because line_bottom_y can modify | ||
| 13501 | its argument, if it moves one line down; see there. */ | ||
| 13502 | int start_y = line_bottom_y (&it1); | ||
| 13503 | |||
| 13504 | do { | ||
| 13505 | move_it_by_lines (&it, 1, 1); | ||
| 13506 | it1 = it; | ||
| 13507 | } while (line_bottom_y (&it1) - start_y < amount_to_scroll); | ||
| 13508 | } | ||
| 13490 | 13509 | ||
| 13491 | /* If STARTP is unchanged, move it down another screen line. */ | 13510 | /* If STARTP is unchanged, move it down another screen line. */ |
| 13492 | if (CHARPOS (it.current.pos) == CHARPOS (startp)) | 13511 | if (CHARPOS (it.current.pos) == CHARPOS (startp)) |