aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2011-08-23 13:35:47 +0300
committerEli Zaretskii <[email protected]>2011-08-23 13:35:47 +0300
commit8ddde6516c5bd15ea8af79800779a28c8742c488 (patch)
treef13e9c484410ede94fdce33878ed45520657adbb /src
parent3bbf23bc315e8cf47c459148dad86adeb3e38242 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d4f654a102..1b1a8f67e4 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,8 @@
2011-08-23 Eli Zaretskii <[email protected]>
+ * 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 9b2b0da431..6a11628f85 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))