From bc17a887d1df07f5a75287ff7d551d548e10f387 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 1 Nov 2011 20:57:03 +0200 Subject: [PATCH] Fix mouse highlight in continued lines on a TTY. src/xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment. Don't stop backward scan on the continuation glyph, even though its CHARPOS is positive. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 14 ++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 37635555a0f..d27a8625407 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-11-01 Eli Zaretskii + + * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment. + Don't stop backward scan on the continuation glyph, even though + its CHARPOS is positive. + 2011-11-01 Martin Rudalics * window.c (temp_output_buffer_show): Don't use diff --git a/src/xdisp.c b/src/xdisp.c index 33c5fc0d230..99d0d69d834 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -25875,10 +25875,10 @@ mouse_face_from_buffer_pos (Lisp_Object window, r2 = next; } /* The rest of the display engine assumes that mouse_face_beg_row is - either above below mouse_face_end_row or identical to it. But - with bidi-reordered continued lines, the row for START_CHARPOS - could be below the row for END_CHARPOS. If so, swap the rows and - store them in correct order. */ + either above mouse_face_end_row or identical to it. But with + bidi-reordered continued lines, the row for START_CHARPOS could + be below the row for END_CHARPOS. If so, swap the rows and store + them in correct order. */ if (r1->y > r2->y) { struct glyph_row *tem = r2; @@ -26030,8 +26030,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, row, and also blanks and stretch glyphs inserted by extend_face_to_end_of_line. */ while (end > glyph - && INTEGERP ((end - 1)->object) - && (end - 1)->charpos <= 0) + && INTEGERP ((end - 1)->object)) --end; /* Scan the rest of the glyph row from the end, looking for the first glyph that comes from BEFORE_STRING, AFTER_STRING, or @@ -26077,8 +26076,7 @@ mouse_face_from_buffer_pos (Lisp_Object window, x = r2->x; end++; while (end < glyph - && INTEGERP (end->object) - && end->charpos <= 0) + && INTEGERP (end->object)) { x += end->pixel_width; ++end; -- 2.39.2