From: Kim F. Storm Date: Sun, 23 Jan 2005 00:50:24 +0000 (+0000) Subject: (window_scroll_pixel_based): Force moving to next line X-Git-Tag: ttn-vms-21-2-B4~2619 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bed83ee4dd0caeb301232cf56dcc8e7f62406bba;p=emacs.git (window_scroll_pixel_based): Force moving to next line if scrolling doesn't move start point, e.g. if looking at tall image. --- diff --git a/src/window.c b/src/window.c index 85376dd7b50..ef3d38c1554 100644 --- a/src/window.c +++ b/src/window.c @@ -4628,8 +4628,16 @@ window_scroll_pixel_based (window, n, whole, noerror) if (dy <= 0) move_it_vertically_backward (&it, -dy); else if (dy > 0) - move_it_to (&it, ZV, -1, it.current_y + dy, -1, - MOVE_TO_POS | MOVE_TO_Y); + { + int start_pos = IT_CHARPOS (it); + move_it_to (&it, ZV, -1, it.current_y + dy, -1, + MOVE_TO_POS | MOVE_TO_Y); + /* Ensure we actually does move, e.g. in case we are currently + looking at an image that is taller that the window height. */ + while (start_pos == IT_CHARPOS (it) + && start_pos < ZV) + move_it_by_lines (&it, 1, 1); + } } else move_it_by_lines (&it, n, 1);