aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2010-10-23 14:28:28 +0200
committerEli Zaretskii2010-10-23 14:28:28 +0200
commit7b7e2c18a64fe2de45d80dfc6f48645f3e126440 (patch)
tree16048ad9656e44f182086d6adbbb9915725db9d4
parentd0010be502380e58590d6e771f7b1853b99897aa (diff)
downloademacs-7b7e2c18a64fe2de45d80dfc6f48645f3e126440.tar.gz
emacs-7b7e2c18a64fe2de45d80dfc6f48645f3e126440.zip
Tested with L2R rows and mouse highlight on a single line.
xdisp.c (mouse_face_from_string_pos): Initialize the `found' flag to zero, and exit the outer loop when it's non-zero. Bail our early if no row in the window belongs to the highlighted string. Always back up after exiting the second loop.
-rw-r--r--src/ChangeLog7
-rw-r--r--src/xdisp.c11
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 04861f77082..0cd77348d12 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12010-10-23 Eli Zaretskii <eliz@gnu.org>
2
3 * xdisp.c (mouse_face_from_string_pos): Initialize the `found'
4 flag to zero, and exit the outer loop when it's non-zero. Bail
5 our early if no row in the window belongs to the highlighted
6 string. Always back up after exiting the second loop.
7
12010-10-16 Eli Zaretskii <eliz@gnu.org> 82010-10-16 Eli Zaretskii <eliz@gnu.org>
2 9
3 * xdisp.c (fast_find_string_pos): #ifdef away, not used anymore. 10 * xdisp.c (fast_find_string_pos): #ifdef away, not used anymore.
diff --git a/src/xdisp.c b/src/xdisp.c
index 9b58e70176d..5a7ba32b678 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -24422,7 +24422,7 @@ mouse_face_from_string_pos (struct window *w, Display_Info *dpyinfo,
24422 struct glyph_row *r; 24422 struct glyph_row *r;
24423 struct glyph *g, *e; 24423 struct glyph *g, *e;
24424 int gx; 24424 int gx;
24425 int found; 24425 int found = 0;
24426 24426
24427 /* Find the glyph row with at least one position in the range 24427 /* Find the glyph row with at least one position in the range
24428 [STARTPOS..ENDPOS), and the leftmost glyph in that row whose 24428 [STARTPOS..ENDPOS), and the leftmost glyph in that row whose
@@ -24451,10 +24451,16 @@ mouse_face_from_string_pos (struct window *w, Display_Info *dpyinfo,
24451 dpyinfo->mouse_face_end_col = g - r->glyphs[TEXT_AREA]; 24451 dpyinfo->mouse_face_end_col = g - r->glyphs[TEXT_AREA];
24452 dpyinfo->mouse_face_end_x = gx; 24452 dpyinfo->mouse_face_end_x = gx;
24453 } 24453 }
24454 found = 1;
24454 break; 24455 break;
24455 } 24456 }
24457 if (found)
24458 break;
24456 } 24459 }
24457 24460
24461 if (!found)
24462 return;
24463
24458 /* Starting with the next row, look for the first row which does NOT 24464 /* Starting with the next row, look for the first row which does NOT
24459 include any glyphs whose positions are in the range. */ 24465 include any glyphs whose positions are in the range. */
24460 for (++r; r->enabled_p && r->y < yb; ++r) 24466 for (++r; r->enabled_p && r->y < yb; ++r)
@@ -24472,9 +24478,8 @@ mouse_face_from_string_pos (struct window *w, Display_Info *dpyinfo,
24472 if (!found) 24478 if (!found)
24473 break; 24479 break;
24474 } 24480 }
24481 r--;
24475 24482
24476 if (!found)
24477 r--;
24478 dpyinfo->mouse_face_end_row = r - w->current_matrix->rows; 24483 dpyinfo->mouse_face_end_row = r - w->current_matrix->rows;
24479 dpyinfo->mouse_face_end_y = r->y; 24484 dpyinfo->mouse_face_end_y = r->y;
24480 24485