]> git.eshelyaron.com Git - emacs.git/commitdiff
(window_scroll_pixel_based): Fix check for reaching BEGV.
authorRichard M. Stallman <rms@gnu.org>
Mon, 23 Dec 2002 18:04:45 +0000 (18:04 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 23 Dec 2002 18:04:45 +0000 (18:04 +0000)
Don't try to make last line fully visible if it is past end of window.

src/window.c

index fb81e45cbc4fe19c6281594a8522a310ab1b517c..3f115260adf5889bfc83ac228afbfb0936a89fd7 100644 (file)
@@ -4149,12 +4149,13 @@ window_scroll_pixel_based (window, n, whole, noerror)
 
   /* 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.  */