changeset 44264:6bcf9f9c10df

(window_scroll_pixel_based): Exit the move_it_by_lines loop whenever it stops making progress.
author Richard M. Stallman <rms@gnu.org>
date Sat, 30 Mar 2002 23:49:39 +0000
parents 13c043393136
children 84ca5c9a3f56
files src/window.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)