From: Eli Zaretskii Date: Tue, 23 Aug 2011 10:35:47 +0000 (+0300) Subject: Fix bug #8874 with recentering and header line under scroll-conservatively. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~70^2~15^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8ddde6516c5bd15ea8af79800779a28c8742c488;p=emacs.git Fix bug #8874 with recentering and header line under scroll-conservatively. src/xdisp.c (redisplay_window): When computing centering_position, account for the height of the header line. --- diff --git a/src/ChangeLog b/src/ChangeLog index d4f654a1028..1b1a8f67e43 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-08-23 Eli Zaretskii + * 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 diff --git a/src/xdisp.c b/src/xdisp.c index 9b2b0da4317..6a11628f858 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -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))