aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2010-10-02 19:42:53 +0200
committerEli Zaretskii2010-10-02 19:42:53 +0200
commite1291a3605edf76f414c7f2919b02d714d41e827 (patch)
treea78fb8f4c5420effad9c5525f091be370481cce4 /src
parent1f382a02c1ca5043c2b2cbaca314578da98af24c (diff)
downloademacs-e1291a3605edf76f414c7f2919b02d714d41e827.tar.gz
emacs-e1291a3605edf76f414c7f2919b02d714d41e827.zip
Fix beg_col calculation when painting from window start.
xdisp.c (mouse_face_from_buffer_pos): Don't compute beg_col if already decided to paint from beginning of window.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog3
-rw-r--r--src/xdisp.c10
2 files changed, 11 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 61afecff203..25649a1a83b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -12,7 +12,8 @@
12 (mouse_face_from_buffer_pos): Rewrite to not assume that 12 (mouse_face_from_buffer_pos): Rewrite to not assume that
13 START_CHARPOS is always in mouse_face_beg_row. If necessary, swap 13 START_CHARPOS is always in mouse_face_beg_row. If necessary, swap
14 mouse_face_beg_row and mouse_face_end_row so that the former is 14 mouse_face_beg_row and mouse_face_end_row so that the former is
15 always above the latter or identical to it. 15 always above the latter or identical to it. Don't compute beg_col
16 if already decided to paint from beginning of window.
16 17
172010-08-28 Eli Zaretskii <eliz@gnu.org> 182010-08-28 Eli Zaretskii <eliz@gnu.org>
18 19
diff --git a/src/xdisp.c b/src/xdisp.c
index 9e65d8f1bb0..eeea4cb4333 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23903,12 +23903,17 @@ mouse_face_from_buffer_pos (Lisp_Object window,
23903 struct glyph *glyph, *end; 23903 struct glyph *glyph, *end;
23904 EMACS_INT ignore, pos; 23904 EMACS_INT ignore, pos;
23905 int x; 23905 int x;
23906 int beg_set = 0;
23906 23907
23907 xassert (NILP (display_string) || STRINGP (display_string)); 23908 xassert (NILP (display_string) || STRINGP (display_string));
23908 xassert (NILP (before_string) || STRINGP (before_string)); 23909 xassert (NILP (before_string) || STRINGP (before_string));
23909 xassert (NILP (after_string) || STRINGP (after_string)); 23910 xassert (NILP (after_string) || STRINGP (after_string));
23910 23911
23911 /* Find the row with START_CHARPOS. */ 23912 /* Find the row with START_CHARPOS. */
23913 /* FIXME: Sometimes the caller gets "wise" and gives us the window
23914 start position instead of the real start of the mouse face
23915 property. This completely messes up the logic of finding the
23916 beg_row and end_row. */
23912 if (start_charpos < MATRIX_ROW_START_CHARPOS (first) 23917 if (start_charpos < MATRIX_ROW_START_CHARPOS (first)
23913 && (NILP (XBUFFER (w->buffer)->bidi_display_reordering) 23918 && (NILP (XBUFFER (w->buffer)->bidi_display_reordering)
23914 || row_containing_pos (w, start_charpos, first, NULL, 0) == NULL)) 23919 || row_containing_pos (w, start_charpos, first, NULL, 0) == NULL))
@@ -23917,6 +23922,7 @@ mouse_face_from_buffer_pos (Lisp_Object window,
23917 dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (first, w->current_matrix); 23922 dpyinfo->mouse_face_beg_row = MATRIX_ROW_VPOS (first, w->current_matrix);
23918 dpyinfo->mouse_face_beg_x = first->x; 23923 dpyinfo->mouse_face_beg_x = first->x;
23919 dpyinfo->mouse_face_beg_y = first->y; 23924 dpyinfo->mouse_face_beg_y = first->y;
23925 beg_set = 1;
23920 } 23926 }
23921 else 23927 else
23922 { 23928 {
@@ -23994,7 +24000,9 @@ mouse_face_from_buffer_pos (Lisp_Object window,
23994 between START_CHARPOS and END_CHARPOS if the range of characters 24000 between START_CHARPOS and END_CHARPOS if the range of characters
23995 strides the bidi level boundary, e.g. if the beginning is in R2L 24001 strides the bidi level boundary, e.g. if the beginning is in R2L
23996 text while the end is in L2R text or vice versa. */ 24002 text while the end is in L2R text or vice versa. */
23997 if (!r1->reversed_p) 24003 if (beg_set)
24004 ;
24005 else if (!r1->reversed_p)
23998 { 24006 {
23999 /* This row is in a left to right paragraph. Scan it left to 24007 /* This row is in a left to right paragraph. Scan it left to
24000 right. */ 24008 right. */