Avoid assertion violations in 'push_prefix_prop'
authorEli Zaretskii <eliz@gnu.org>
Sun, 21 Apr 2024 13:06:34 +0000 (16:06 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 21 Apr 2024 13:06:34 +0000 (16:06 +0300)
* src/xdisp.c (push_prefix_prop): Set the
'string_from_prefix_prop_p' flag for any valid value of the
'line-prefix' or 'wrap-prefix' property/variable.  (Bug#70495)

src/dispextern.h
src/xdisp.c

index de46658dc0acc016e0edd584d0d63e93d2270db7..1590fa64436da11966b2cfe2ef7e2d12c0b6e5d5 100644 (file)
@@ -2373,7 +2373,9 @@ struct it
   bool_bf string_from_display_prop_p : 1;
 
   /* True means `string' comes from a `line-prefix' or `wrap-prefix'
-     property.  */
+     property, and that these properties were already handled, even if
+     their value is not a string.  This is used to avoid processing
+     the same line/wrap prefix more than once for the same glyph row.  */
   bool_bf string_from_prefix_prop_p : 1;
 
   /* True means we are iterating an object that came from a value of a
index a9eb47720d0d7dbf61699b0eb173867b0f80f4b9..6e945ed114b7095e3c5d1c619353c66ae3e9c7f3 100644 (file)
@@ -24030,6 +24030,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
     {
       it->method = GET_FROM_STRETCH;
       it->object = prop;
+      it->string_from_prefix_prop_p = true;
     }
 #ifdef HAVE_WINDOW_SYSTEM
   else if (IMAGEP (prop))
@@ -24037,6 +24038,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop)
       it->what = IT_IMAGE;
       it->image_id = lookup_image (it->f, prop, it->face_id);
       it->method = GET_FROM_IMAGE;
+      it->string_from_prefix_prop_p = true;
     }
 #endif /* HAVE_WINDOW_SYSTEM */
   else