2001-02-05 Gerd Moellmann <gerd@gnu.org>
+ * xdisp.c (try_scrolling): If point is in the line below the
+ window, make sure to move the iterator at least a canonical
+ char height down.
+
* window.c (Fmove_to_window_line): Don't add 1 if window is
vscrolled.
if (PT >= CHARPOS (scroll_margin_pos))
{
int y0;
-#if 0
- int line_height;
-#endif
/* Point is in the scroll margin at the bottom of the window, or
below. Compute a new window start that makes point visible. */
y0 = it.current_y;
move_it_to (&it, PT, 0, it.last_visible_y, -1,
MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
-#if 0 /* Taking the line's height into account here looks wrong. */
- line_height = (it.max_ascent + it.max_descent
- ? it.max_ascent + it.max_descent
- : last_height);
- dy = it.current_y + line_height - y0;
-#else
+
/* With a scroll_margin of 0, scroll_margin_pos is at the window
end, which is one line below the window. The iterator's
current_y will be same as y0 in that case, but we have to
scroll a line to make PT visible. That's the reason why 1 is
added below. */
dy = 1 + it.current_y - y0;
-#endif
if (dy > scroll_max)
return 0;
start_display (&it, w, startp);
if (scroll_conservatively)
- amount_to_scroll =
- max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step));
+ amount_to_scroll
+ = max (max (dy, CANON_Y_UNIT (f)),
+ CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step));
else if (scroll_step || temp_scroll_step)
amount_to_scroll = scroll_max;
else