diff options
| -rw-r--r-- | src/window.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index fb81e45cbc4..3f115260adf 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -4149,12 +4149,13 @@ window_scroll_pixel_based (window, n, whole, noerror) | |||
| 4149 | 4149 | ||
| 4150 | /* End if we end up at ZV or BEGV. */ | 4150 | /* End if we end up at ZV or BEGV. */ |
| 4151 | if ((n > 0 && IT_CHARPOS (it) == ZV) | 4151 | if ((n > 0 && IT_CHARPOS (it) == ZV) |
| 4152 | || (n < 0 && IT_CHARPOS (it) == CHARPOS (start))) | 4152 | || (n < 0 && IT_CHARPOS (it) == BEGV)) |
| 4153 | { | 4153 | { |
| 4154 | if (IT_CHARPOS (it) == ZV) | 4154 | if (IT_CHARPOS (it) == ZV) |
| 4155 | { | 4155 | { |
| 4156 | if (it.current_y + it.max_ascent + it.max_descent | 4156 | if (it.current_y < it.last_visible_y |
| 4157 | > it.last_visible_y) | 4157 | && (it.current_y + it.max_ascent + it.max_descent |
| 4158 | >= it.last_visible_y)) | ||
| 4158 | { | 4159 | { |
| 4159 | /* The last line was only partially visible, make it fully | 4160 | /* The last line was only partially visible, make it fully |
| 4160 | visible. */ | 4161 | visible. */ |