(try_scrolling): If point is in the line below the
window, make sure to move the iterator at least a canonical char height down.
This commit is contained in:
parent
e16f52ce8f
commit
e89aaabdcb
2 changed files with 8 additions and 12 deletions
|
@ -1,5 +1,9 @@
|
|||
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.
|
||||
|
||||
|
|
16
src/xdisp.c
16
src/xdisp.c
|
@ -9005,9 +9005,6 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
|
|||
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 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
|
|||
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 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue