Fix scrolling with scroll-*-aggressively.

Aggressive scrolling backward by large distance still doesn't DTRT.

 src/xdisp.c (try_scrolling): When aggressive scrolling is in use, don't
 let point enter the opposite scroll margin as result of the scroll.
 (redisplay_window): Fix operator precedence in condition.
This commit is contained in:
Eli Zaretskii 2011-03-27 00:05:30 +02:00
parent 06b6bbb578
commit 3b2c5ab1f0
2 changed files with 13 additions and 1 deletions

View file

@ -8,6 +8,9 @@
(redisplay_window): Even when falling back on "recentering",
position point in the window according to scroll-conservatively,
scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
(try_scrolling): When aggressive scrolling is in use, don't let
point enter the opposite scroll margin as result of the scroll.
(redisplay_window): Fix operator precedence in condition.
2011-03-26 Juanma Barranquero <lekktu@gmail.com>

View file

@ -13125,6 +13125,10 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
amount_to_scroll = float_amount;
if (amount_to_scroll == 0 && float_amount > 0)
amount_to_scroll = 1;
/* Don't let point enter the scroll margin near top of
the window. */
if (amount_to_scroll > height - 2*this_scroll_margin + dy)
amount_to_scroll = height - 2*this_scroll_margin + dy;
}
}
@ -13208,6 +13212,11 @@ try_scrolling (Lisp_Object window, int just_this_one_p,
amount_to_scroll = float_amount;
if (amount_to_scroll == 0 && float_amount > 0)
amount_to_scroll = 1;
amount_to_scroll -= this_scroll_margin - dy;
/* Don't let point enter the scroll margin near
bottom of the window. */
if (amount_to_scroll > height - 2*this_scroll_margin + dy)
amount_to_scroll = height - 2*this_scroll_margin + dy;
}
}
@ -14236,7 +14245,7 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
: BVAR (current_buffer, scroll_down_aggressively);
if (!MINI_WINDOW_P (w)
&& scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive))
&& (scroll_conservatively > SCROLL_LIMIT || NUMBERP (aggressive)))
{
int pt_offset = 0;