From: Richard M. Stallman Date: Sat, 30 Mar 2002 23:49:39 +0000 (+0000) Subject: (window_scroll_pixel_based): Exit the move_it_by_lines X-Git-Tag: ttn-vms-21-2-B4~15889 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e9b2c9617c85f827ce8362a755ebbd2d403eced3;p=emacs.git (window_scroll_pixel_based): Exit the move_it_by_lines loop whenever it stops making progress. --- diff --git a/src/window.c b/src/window.c index 2ea7cd1d6dd..3535e50673e 100644 --- a/src/window.c +++ b/src/window.c @@ -4154,7 +4154,12 @@ window_scroll_pixel_based (window, n, whole, noerror) in the scroll margin at the top. */ move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); while (it.current_y < this_scroll_margin) - move_it_by_lines (&it, 1, 1); + { + int prev = it.current_y; + move_it_by_lines (&it, 1, 1); + if (prev == it.current_y) + break; + } SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); } else if (n < 0)