aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2006-03-19 19:38:48 +0000
committerKim F. Storm2006-03-19 19:38:48 +0000
commit3dcef10bbc435cc2d2b89670366500603fd6f31b (patch)
tree199d21d7b22c096b6432c04d00abf2505f4219ed
parentd79c9e9d25a709b84a858ca58f1562b21f2d573d (diff)
downloademacs-3dcef10bbc435cc2d2b89670366500603fd6f31b.tar.gz
emacs-3dcef10bbc435cc2d2b89670366500603fd6f31b.zip
(set_cursor_from_row): Fix cursor property on overlay string,
so it doesn't associate overlay string with following glyph by default. Allow integer property value to specify explicit number of buffer positions associate with overlay string.
-rw-r--r--src/xdisp.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 9481bbbc153..7b1c5cd96fb 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -11604,7 +11604,7 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
11604 x += glyph->pixel_width; 11604 x += glyph->pixel_width;
11605 ++glyph; 11605 ++glyph;
11606 if (cursor_from_overlay_pos 11606 if (cursor_from_overlay_pos
11607 && last_pos > cursor_from_overlay_pos) 11607 && last_pos >= cursor_from_overlay_pos)
11608 { 11608 {
11609 cursor_from_overlay_pos = 0; 11609 cursor_from_overlay_pos = 0;
11610 cursor = 0; 11610 cursor = 0;
@@ -11618,10 +11618,12 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
11618 /* Skip all glyphs from string. */ 11618 /* Skip all glyphs from string. */
11619 do 11619 do
11620 { 11620 {
11621 Lisp_Object cprop;
11621 int pos; 11622 int pos;
11622 if ((cursor == NULL || glyph > cursor) 11623 if ((cursor == NULL || glyph > cursor)
11623 && !NILP (Fget_char_property (make_number ((glyph)->charpos), 11624 && (cprop = Fget_char_property (make_number ((glyph)->charpos),
11624 Qcursor, (glyph)->object)) 11625 Qcursor, (glyph)->object),
11626 !NILP (cprop))
11625 && (pos = string_buffer_position (w, glyph->object, 11627 && (pos = string_buffer_position (w, glyph->object,
11626 string_before_pos), 11628 string_before_pos),
11627 (pos == 0 /* From overlay */ 11629 (pos == 0 /* From overlay */
@@ -11632,14 +11634,15 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
11632 Add 1 to last_pos so that if point corresponds to the 11634 Add 1 to last_pos so that if point corresponds to the
11633 glyph right after the overlay, we still use a 'cursor' 11635 glyph right after the overlay, we still use a 'cursor'
11634 property found in that overlay. */ 11636 property found in that overlay. */
11635 cursor_from_overlay_pos = pos == 0 ? last_pos+1 : 0; 11637 cursor_from_overlay_pos = (pos ? 0 : last_pos
11638 + (INTEGERP (cprop) ? XINT (cprop) : 0));
11636 cursor = glyph; 11639 cursor = glyph;
11637 cursor_x = x; 11640 cursor_x = x;
11638 } 11641 }
11639 x += glyph->pixel_width; 11642 x += glyph->pixel_width;
11640 ++glyph; 11643 ++glyph;
11641 } 11644 }
11642 while (glyph < end && STRINGP (glyph->object)); 11645 while (glyph < end && EQ (glyph->object, string_start->object));
11643 } 11646 }
11644 } 11647 }
11645 11648