]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #8874 with recentering and header line under scroll-conservatively.
authorEli Zaretskii <eliz@gnu.org>
Tue, 23 Aug 2011 10:35:47 +0000 (13:35 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 23 Aug 2011 10:35:47 +0000 (13:35 +0300)
 src/xdisp.c (redisplay_window): When computing centering_position,
 account for the height of the header line.

src/ChangeLog
src/xdisp.c

index d4f654a1028249b092d1bea5e7ad52b5f5cc0194..1b1a8f67e43123004502f8af33345c84734a1562 100644 (file)
@@ -1,5 +1,8 @@
 2011-08-23  Eli Zaretskii  <eliz@gnu.org>
 
+       * xdisp.c (redisplay_window): When computing centering_position,
+       account for the height of the header line.  (Bug#8874)
+
        * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
        instead of CHAR_TO_BYTE.  Fixes a crash when a completion
        candidate is selected by the mouse, and that candidate has a
index 9b2b0da4317e5d59e056740be564045b128cbc45..6a11628f858814d3d863a54d7e2ac12084dc5eef 100644 (file)
@@ -15244,7 +15244,8 @@ redisplay_window (Lisp_Object window, int just_this_one_p)
              if (pt_offset)
                centering_position -= pt_offset;
              centering_position -=
-               FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0));
+               FRAME_LINE_HEIGHT (f) * (1 + margin + (last_line_misfit != 0))
+               + WINDOW_HEADER_LINE_HEIGHT (w);
              /* Don't let point enter the scroll margin near top of
                 the window.  */
              if (centering_position < margin * FRAME_LINE_HEIGHT (f))