diff options
| author | Chong Yidong | 2008-10-27 05:15:37 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-10-27 05:15:37 +0000 |
| commit | 95c97c11e0fbd7d6550e44fee82500d4c2896700 (patch) | |
| tree | e898c6598294cf96d88f4e8439747b5714a50f62 /src | |
| parent | 6584f2854b764fdbe7013b95df63bcfafb2e8d6f (diff) | |
| download | emacs-95c97c11e0fbd7d6550e44fee82500d4c2896700.tar.gz emacs-95c97c11e0fbd7d6550e44fee82500d4c2896700.zip | |
(try_scrolling): When computing distance from the scroll margin, don't
use MOVE_TO_Y.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index b7c05f9eed4..d2b62b1ffe0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12622,7 +12622,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 12622 | struct text_pos pos, startp; | 12622 | struct text_pos pos, startp; |
| 12623 | struct it it; | 12623 | struct it it; |
| 12624 | int this_scroll_margin, scroll_max, rc, height; | 12624 | int this_scroll_margin, scroll_max, rc, height; |
| 12625 | int dy = 0, amount_to_scroll = 0, scroll_down_p = 0; | 12625 | int dy = 0, amount_to_scroll = 0; |
| 12626 | int extra_scroll_margin_lines = last_line_misfit ? 1 : 0; | 12626 | int extra_scroll_margin_lines = last_line_misfit ? 1 : 0; |
| 12627 | Lisp_Object aggressive; | 12627 | Lisp_Object aggressive; |
| 12628 | int scroll_limit = INT_MAX / FRAME_LINE_HEIGHT (f); | 12628 | int scroll_limit = INT_MAX / FRAME_LINE_HEIGHT (f); |
| @@ -12687,8 +12687,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 12687 | window, or below. Compute the distance from the scroll | 12687 | window, or below. Compute the distance from the scroll |
| 12688 | margin to PT, and give up if the distance is greater than | 12688 | margin to PT, and give up if the distance is greater than |
| 12689 | scroll_max. */ | 12689 | scroll_max. */ |
| 12690 | move_it_to (&it, PT, -1, it.last_visible_y - 1, -1, | 12690 | move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
| 12691 | MOVE_TO_POS | MOVE_TO_Y); | ||
| 12692 | 12691 | ||
| 12693 | /* To make point visible, we must move the window start down | 12692 | /* To make point visible, we must move the window start down |
| 12694 | so that the cursor line is visible, which means we have | 12693 | so that the cursor line is visible, which means we have |
| @@ -12697,18 +12696,11 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 12697 | 12696 | ||
| 12698 | if (dy > scroll_max) | 12697 | if (dy > scroll_max) |
| 12699 | return SCROLLING_FAILED; | 12698 | return SCROLLING_FAILED; |
| 12700 | |||
| 12701 | scroll_down_p = 1; | ||
| 12702 | } | 12699 | } |
| 12703 | } | 12700 | } |
| 12704 | 12701 | ||
| 12705 | if (scroll_down_p) | 12702 | if (dy > 0) |
| 12706 | { | 12703 | { |
| 12707 | /* Move the window start down. If scrolling conservatively, | ||
| 12708 | move it just enough down to make point visible. If | ||
| 12709 | scroll_step is set, move it down by scroll_step. */ | ||
| 12710 | start_display (&it, w, startp); | ||
| 12711 | |||
| 12712 | if (scroll_conservatively) | 12704 | if (scroll_conservatively) |
| 12713 | /* Set AMOUNT_TO_SCROLL to at least one line, | 12705 | /* Set AMOUNT_TO_SCROLL to at least one line, |
| 12714 | and at most scroll_conservatively lines. */ | 12706 | and at most scroll_conservatively lines. */ |
| @@ -12733,10 +12725,14 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, | |||
| 12733 | if (amount_to_scroll <= 0) | 12725 | if (amount_to_scroll <= 0) |
| 12734 | return SCROLLING_FAILED; | 12726 | return SCROLLING_FAILED; |
| 12735 | 12727 | ||
| 12728 | /* Move the window start down. If scrolling conservatively, | ||
| 12729 | move it just enough down to make point visible. If | ||
| 12730 | scroll_step is set, move it down by scroll_step. */ | ||
| 12731 | start_display (&it, w, startp); | ||
| 12732 | move_it_vertically (&it, amount_to_scroll); | ||
| 12733 | |||
| 12736 | /* If moving by amount_to_scroll leaves STARTP unchanged, | 12734 | /* If moving by amount_to_scroll leaves STARTP unchanged, |
| 12737 | move it down one screen line. */ | 12735 | move it down one screen line. */ |
| 12738 | |||
| 12739 | move_it_vertically (&it, amount_to_scroll); | ||
| 12740 | if (CHARPOS (it.current.pos) == CHARPOS (startp)) | 12736 | if (CHARPOS (it.current.pos) == CHARPOS (startp)) |
| 12741 | move_it_by_lines (&it, 1, 1); | 12737 | move_it_by_lines (&it, 1, 1); |
| 12742 | startp = it.current.pos; | 12738 | startp = it.current.pos; |