aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2011-10-08 12:58:50 +0200
committerEli Zaretskii <[email protected]>2011-10-08 12:58:50 +0200
commit352ec8ffdd1ef4e5f335b921e0590ff746bebd5d (patch)
treee7bc07eb0f46c7ca382c86c151b22784341c2b89 /src
parent8c069cc768d5b63f0d136dd91985ac2eb5ffd1cd (diff)
Fix bug #4426 with buffer_posn_from_coords when header line is present.
dispnew.c (buffer_posn_from_coords): Account it.vpos for a possible presence of header-line.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/dispnew.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 38c452f354..edfecaa093 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-10-08 Eli Zaretskii <[email protected]>
+
+ * dispnew.c (buffer_posn_from_coords): Account for a possible
+ presence of header-line. (Bug#4426)
+
2011-10-07 Stefan Monnier <[email protected]>
* buffer.c (syms_of_buffer) <enable-multibyte-characters>: Don't
diff --git a/src/dispnew.c b/src/dispnew.c
index 51b17fc0f1..46d1917b14 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5261,6 +5261,10 @@ buffer_posn_from_coords (struct window *w, int *x, int *y, struct display_pos *p
CHARPOS (startp) = min (ZV, max (BEGV, CHARPOS (startp)));
BYTEPOS (startp) = min (ZV_BYTE, max (BEGV_BYTE, BYTEPOS (startp)));
start_display (&it, w, startp);
+ /* start_display takes into account the header-line row, but IT's
+ vpos still counts from the glyph row that includes the window's
+ start position. Adjust for a possible header-line row. */
+ it.vpos += WINDOW_WANTS_HEADER_LINE_P (w) ? 1 : 0;
x0 = *x;