]> code.delx.au - gnu-emacs/commitdiff
(try_window): Fix previous change in how it handles
authorRichard M. Stallman <rms@gnu.org>
Sun, 3 Jul 2005 16:51:02 +0000 (16:51 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sun, 3 Jul 2005 16:51:02 +0000 (16:51 +0000)
a partially-visible line or one only partly past the margin.

src/xdisp.c

index 40e83c7d37c4248a937558187ea4183809957056..988aab3a8259c4d8dbcc922af2b0525e5715dedb 100644 (file)
@@ -12740,11 +12740,11 @@ try_window (window, pos, check_margins)
 
       if ((w->cursor.y < this_scroll_margin
           && CHARPOS (pos) > BEGV)
-         /* Old redisplay didn't take scroll margin into account at the bottom,
-            but then global-hl-line-mode doesn't scroll.  KFS 2004-06-14 */
-         || (w->cursor.y + (make_cursor_line_fully_visible_p
-                            ? cursor_height + this_scroll_margin
-                            : 1)) > it.last_visible_y)
+         /* rms: considering make_cursor_line_fully_visible_p here
+            seems to give wrong results.  We don't want to recenter
+            when the last line is partly visible, we want to allow
+            that case to be handled in the usual way.  */
+         || (w->cursor.y + 1) > it.last_visible_y)
        {
          w->cursor.vpos = -1;
          clear_glyph_matrix (w->desired_matrix);