changeset 56963:e5690f1ff0a5

(set_cursor_from_row): Fix last change. Only use 'cursor' property from text property or overlay strings at point.
author Kim F. Storm <storm@cua.dk>
date Tue, 07 Sep 2004 20:51:16 +0000
parents 587d59561e32
children eaf57d83bae6
files src/xdisp.c
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Tue Sep 07 18:21:45 2004 +0000
+++ b/src/xdisp.c	Tue Sep 07 20:51:16 2004 +0000
@@ -10659,6 +10659,7 @@
   int string_before_pos;
   int x = row->x;
   int cursor_x = x;
+  int cursor_from_overlay_pos = 0;
   int pt_old = PT - delta;
 
   /* Skip over glyphs not having an object at the start of the row.
@@ -10684,6 +10685,12 @@
 	  string_start = NULL;
 	  x += glyph->pixel_width;
 	  ++glyph;
+	  if (cursor_from_overlay_pos
+	      && last_pos > cursor_from_overlay_pos)
+	    {
+	      cursor_from_overlay_pos = 0;
+	      cursor = 0;
+	    }
 	}
       else
 	{
@@ -10693,10 +10700,16 @@
 	  /* Skip all glyphs from string.  */
 	  do
 	    {
+	      int pos;
 	      if ((cursor == NULL || glyph > cursor)
 		  && !NILP (Fget_char_property (make_number ((glyph)->charpos),
-						Qcursor, (glyph)->object)))
-		{
+						Qcursor, (glyph)->object))
+		  && (pos = string_buffer_position (w, glyph->object,
+						    string_before_pos),
+		      (pos == 0	  /* From overlay */
+		       || pos == pt_old)))
+		{
+		  cursor_from_overlay_pos = pos == 0 ? last_pos : 0;
 		  cursor = glyph;
 		  cursor_x = x;
 		}