# HG changeset patch # User Richard M. Stallman # Date 1017532179 0 # Node ID 6bcf9f9c10df4076875fb801c4d6dde41c1a3bec # Parent 13c043393136fb89b7a58e5fb254d5667a78302c (window_scroll_pixel_based): Exit the move_it_by_lines loop whenever it stops making progress. diff -r 13c043393136 -r 6bcf9f9c10df src/window.c --- a/src/window.c Sat Mar 30 23:48:04 2002 +0000 +++ b/src/window.c Sat Mar 30 23:49:39 2002 +0000 @@ -4154,7 +4154,12 @@ 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)