From bf96464e2f731c9b7a9f9589b2de001a03ed3f2f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 22 May 2017 21:15:17 +0300 Subject: [PATCH] Fix current-line hscrolling in buffers with header-line * src/xdisp.c (display_line): When testing the glyph row's vertical position against the cursor position, account for header line, if any. (Bug#27014) --- src/xdisp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 05880617385..ddb26b8defd 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20671,7 +20671,9 @@ display_line (struct it *it, int cursor_vpos) ptrdiff_t min_pos = ZV + 1, max_pos = 0; ptrdiff_t min_bpos UNINIT, max_bpos UNINIT; bool pending_handle_line_prefix = false; - bool hscroll_this_line = (cursor_vpos >= 0 && it->vpos == cursor_vpos + int header_line = WINDOW_WANTS_HEADER_LINE_P (it->w); + bool hscroll_this_line = (cursor_vpos >= 0 + && it->vpos == cursor_vpos - header_line && hscrolling_current_line_p (it->w)); int first_visible_x = it->first_visible_x; int last_visible_x = it->last_visible_x; -- 2.39.2