From da02157ee69c6ae2a220a8f38a9cd8c0f7105641 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Mon, 19 Aug 2024 17:38:47 -0700 Subject: [PATCH] Fix bad interaction between 'min-width' display spec and overlays * src/xdisp.c (handle_display_prop): Don't handle 'min-width' when iterating over a string (bug#72721). --- src/xdisp.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 30771a1c83d..bd6657fe522 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5791,14 +5791,18 @@ handle_display_prop (struct it *it) propval = get_char_property_and_overlay (make_fixnum (position->charpos), Qdisplay, object, &overlay); - /* Rest of the code must have OBJECT be either a string or a buffer. */ + if (!STRINGP (it->string)) - object = it->w->contents; + { + /* Rest of the code must have OBJECT be either a string or a buffer. */ + object = it->w->contents; - /* Handle min-width ends. */ - if (!NILP (it->min_width_property) - && NILP (find_display_property (propval, Qmin_width))) - display_min_width (it, bufpos, object, Qnil); + /* Handle min-width ends. This doesn't apply while iterating over + a string. */ + if (!NILP (it->min_width_property) + && NILP (find_display_property (propval, Qmin_width))) + display_min_width (it, bufpos, object, Qnil); + } if (NILP (propval)) return HANDLED_NORMALLY; -- 2.25.1