Mercurial > emacs
changeset 35893:ce76268f843e
(try_scrolling): If point is in the line below the
window, make sure to move the iterator at least a canonical
char height down.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Mon, 05 Feb 2001 13:02:23 +0000 |
parents | 6557a29284df |
children | 929f95a3bf33 |
files | src/xdisp.c |
diffstat | 1 files changed, 4 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xdisp.c Mon Feb 05 12:24:27 2001 +0000 +++ b/src/xdisp.c Mon Feb 05 13:02:23 2001 +0000 @@ -9005,9 +9005,6 @@ 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. */ @@ -9018,19 +9015,13 @@ 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; @@ -9041,8 +9032,9 @@ 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