changeset 48945:a96801f68a82

(window_scroll_pixel_based): Fix check for reaching BEGV. Don't try to make last line fully visible if it is past end of window.
author Richard M. Stallman <rms@gnu.org>
date Mon, 23 Dec 2002 18:04:45 +0000
parents eb0fffb378cd
children 2c4a754e02b6
files src/window.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Mon Dec 23 17:59:54 2002 +0000
+++ b/src/window.c	Mon Dec 23 18:04:45 2002 +0000
@@ -4149,12 +4149,13 @@
 
   /* End if we end up at ZV or BEGV.  */
   if ((n > 0 && IT_CHARPOS (it) == ZV)
-      || (n < 0 && IT_CHARPOS (it) == CHARPOS (start)))
+      || (n < 0 && IT_CHARPOS (it) == BEGV))
     {
       if (IT_CHARPOS (it) == ZV)
 	{
-	  if (it.current_y + it.max_ascent + it.max_descent
-	      > it.last_visible_y)
+	  if (it.current_y < it.last_visible_y
+	      && (it.current_y + it.max_ascent + it.max_descent
+		  >= it.last_visible_y))
 	    {
 	      /* The last line was only partially visible, make it fully
 		 visible.  */