emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114439: Fix bug #15437 with mouse highlight on over


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r114439: Fix bug #15437 with mouse highlight on overlay strings.
Date: Mon, 23 Sep 2013 09:19:22 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114439
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15437
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Mon 2013-09-23 12:18:38 +0300
message:
  Fix bug #15437 with mouse highlight on overlay strings.
  
   src/xdisp.c (mouse_face_from_string_pos): Fix off-by-one error in
   computing the end column of mouse-highlight that comes from
   display or overlay strings.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-09-23 08:25:48 +0000
+++ b/src/ChangeLog     2013-09-23 09:18:38 +0000
@@ -1,5 +1,9 @@
 2013-09-23  Eli Zaretskii  <address@hidden>
 
+       * xdisp.c (mouse_face_from_string_pos): Fix off-by-one error in
+       computing the end column of mouse-highlight that comes from
+       display or overlay strings.  (Bug#15437)
+
        * conf_post.h (__has_builtin): Define to zero, if undefined, on
        all platforms, not just for clang.
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-09-22 07:13:14 +0000
+++ b/src/xdisp.c       2013-09-23 09:18:38 +0000
@@ -27381,7 +27381,7 @@
 #endif /* not used */
 
 /* Find the positions of the first and the last glyphs in window W's
-   current matrix that occlude positions [STARTPOS..ENDPOS] in OBJECT
+   current matrix that occlude positions [STARTPOS..ENDPOS) in OBJECT
    (assumed to be a string), and return in HLINFO's mouse_face_*
    members the pixel and column/row coordinates of those glyphs.  */
 
@@ -27397,7 +27397,7 @@
   int found = 0;
 
   /* Find the glyph row with at least one position in the range
-     [STARTPOS..ENDPOS], and the first glyph in that row whose
+     [STARTPOS..ENDPOS), and the first glyph in that row whose
      position belongs to that range.  */
   for (r = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
        r->enabled_p && r->y < yb;
@@ -27409,7 +27409,7 @@
          e = g + r->used[TEXT_AREA];
          for (gx = r->x; g < e; gx += g->pixel_width, ++g)
            if (EQ (g->object, object)
-               && startpos <= g->charpos && g->charpos <= endpos)
+               && startpos <= g->charpos && g->charpos < endpos)
              {
                hlinfo->mouse_face_beg_row
                  = MATRIX_ROW_VPOS (r, w->current_matrix);
@@ -27427,7 +27427,7 @@
          g = e + r->used[TEXT_AREA];
          for ( ; g > e; --g)
            if (EQ ((g-1)->object, object)
-               && startpos <= (g-1)->charpos && (g-1)->charpos <= endpos)
+               && startpos <= (g-1)->charpos && (g-1)->charpos < endpos)
              {
                hlinfo->mouse_face_beg_row
                  = MATRIX_ROW_VPOS (r, w->current_matrix);
@@ -27455,7 +27455,7 @@
       found = 0;
       for ( ; g < e; ++g)
        if (EQ (g->object, object)
-           && startpos <= g->charpos && g->charpos <= endpos)
+           && startpos <= g->charpos && g->charpos < endpos)
          {
            found = 1;
            break;
@@ -27478,7 +27478,7 @@
       e = g + r->used[TEXT_AREA];
       for ( ; e > g; --e)
        if (EQ ((e-1)->object, object)
-           && startpos <= (e-1)->charpos && (e-1)->charpos <= endpos)
+           && startpos <= (e-1)->charpos && (e-1)->charpos < endpos)
          break;
       hlinfo->mouse_face_end_col = e - g;
 
@@ -27493,7 +27493,7 @@
       for (gx = r->x ; e < g; ++e)
        {
          if (EQ (e->object, object)
-             && startpos <= e->charpos && e->charpos <= endpos)
+             && startpos <= e->charpos && e->charpos < endpos)
            break;
          gx += e->pixel_width;
        }


reply via email to

[Prev in Thread] Current Thread [Next in Thread]