]> git.eshelyaron.com Git - emacs.git/commitdiff
(try_scrolling): If point is in the line below the
authorGerd Moellmann <gerd@gnu.org>
Mon, 5 Feb 2001 13:02:51 +0000 (13:02 +0000)
committerGerd Moellmann <gerd@gnu.org>
Mon, 5 Feb 2001 13:02:51 +0000 (13:02 +0000)
window, make sure to move the iterator at least a canonical
char height down.

src/ChangeLog
src/xdisp.c

index 385a98fe1be24df43bd3bf42636bcb9793188939..f43f38997cb5622a5ab8ee31ff31e1c46c3ae11f 100644 (file)
@@ -1,5 +1,9 @@
 2001-02-05  Gerd Moellmann  <gerd@gnu.org>
 
+       * xdisp.c (try_scrolling): If point is in the line below the
+       window, make sure to move the iterator at least a canonical
+       char height down.
+
        * window.c (Fmove_to_window_line): Don't add 1 if window is
        vscrolled.
 
index eaaff196079d54db0369580f62f0a8ddd38d87bc..94e3f41b14c1e3cbf7fdbd5b1b7f0f59f3a59ad3 100644 (file)
@@ -9005,9 +9005,6 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
   if (PT >= CHARPOS (scroll_margin_pos))
     {
       int y0;
-#if 0
-      int line_height;
-#endif
       
       /* Point is in the scroll margin at the bottom of the window, or
         below.  Compute a new window start that makes point visible.  */
@@ -9018,19 +9015,13 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
       y0 = it.current_y;
       move_it_to (&it, PT, 0, it.last_visible_y, -1,
                  MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y);
-#if 0 /* Taking the line's height into account here looks wrong.  */
-      line_height = (it.max_ascent + it.max_descent
-                    ? it.max_ascent + it.max_descent
-                    : last_height);
-      dy = it.current_y + line_height - y0;
-#else
+      
       /* With a scroll_margin of 0, scroll_margin_pos is at the window
         end, which is one line below the window.  The iterator's
         current_y will be same as y0 in that case, but we have to
         scroll a line to make PT visible.  That's the reason why 1 is
         added below.  */
       dy = 1 + it.current_y - y0;
-#endif
       
       if (dy > scroll_max)
        return 0;
@@ -9041,8 +9032,9 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
       start_display (&it, w, startp);
 
       if (scroll_conservatively)
-       amount_to_scroll =
-         max (dy, CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step));
+       amount_to_scroll
+         = max (max (dy, CANON_Y_UNIT (f)),
+                CANON_Y_UNIT (f) * max (scroll_step, temp_scroll_step));
       else if (scroll_step || temp_scroll_step)
        amount_to_scroll = scroll_max;
       else