4049 |
else |
else |
4050 |
move_it_by_lines (&it, n, 1); |
move_it_by_lines (&it, n, 1); |
4051 |
|
|
4052 |
/* End if we end up at ZV or BEGV. */ |
/* We failed if we find ZV is already on the screen (scrolling up, |
4053 |
|
means there's nothing past the end), or if we can't start any |
4054 |
|
earlier (scrolling down, means there's nothing past the top). */ |
4055 |
if ((n > 0 && IT_CHARPOS (it) == ZV) |
if ((n > 0 && IT_CHARPOS (it) == ZV) |
4056 |
|| (n < 0 && IT_CHARPOS (it) == CHARPOS (start))) |
|| (n < 0 && IT_CHARPOS (it) == CHARPOS (start))) |
4057 |
{ |
{ |
4058 |
if (IT_CHARPOS (it) == ZV) |
if (IT_CHARPOS (it) == ZV) |
4059 |
{ |
{ |
4060 |
if (it.current_y + it.max_ascent + it.max_descent |
if (it.current_y < it.last_visible_y |
4061 |
> it.last_visible_y) |
&& (it.current_y + it.max_ascent + it.max_descent |
4062 |
|
>= it.last_visible_y)) |
4063 |
{ |
{ |
4064 |
/* The last line was only partially visible, make it fully |
/* The last line was only partially visible, make it fully |
4065 |
visible. */ |
visible. */ |
4094 |
|
|
4095 |
if (! vscrolled) |
if (! vscrolled) |
4096 |
{ |
{ |
4097 |
|
int pos = IT_CHARPOS (it); |
4098 |
|
int bytepos; |
4099 |
|
|
4100 |
|
/* If in the middle of a multi-glyph character move forward to |
4101 |
|
the next character. */ |
4102 |
|
if (in_display_vector_p (&it)) |
4103 |
|
{ |
4104 |
|
++pos; |
4105 |
|
move_it_to (&it, pos, -1, -1, -1, MOVE_TO_POS); |
4106 |
|
} |
4107 |
|
|
4108 |
/* Set the window start, and set up the window for redisplay. */ |
/* Set the window start, and set up the window for redisplay. */ |
4109 |
set_marker_restricted (w->start, make_number (IT_CHARPOS (it)), |
set_marker_restricted (w->start, make_number (pos), |
4110 |
w->buffer); |
w->buffer); |
4111 |
w->start_at_line_beg = Fbolp (); |
bytepos = XMARKER (w->start)->bytepos; |
4112 |
|
w->start_at_line_beg = ((pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n') |
4113 |
|
? Qt : Qnil); |
4114 |
w->update_mode_line = Qt; |
w->update_mode_line = Qt; |
4115 |
XSETFASTINT (w->last_modified, 0); |
XSETFASTINT (w->last_modified, 0); |
4116 |
XSETFASTINT (w->last_overlay_modified, 0); |
XSETFASTINT (w->last_overlay_modified, 0); |
4140 |
in the scroll margin at the top. */ |
in the scroll margin at the top. */ |
4141 |
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); |
4142 |
while (it.current_y < this_scroll_margin) |
while (it.current_y < this_scroll_margin) |
4143 |
move_it_by_lines (&it, 1, 1); |
{ |
4144 |
|
int prev = it.current_y; |
4145 |
|
move_it_by_lines (&it, 1, 1); |
4146 |
|
if (prev == it.current_y) |
4147 |
|
break; |
4148 |
|
} |
4149 |
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
4150 |
} |
} |
4151 |
else if (n < 0) |
else if (n < 0) |