From 0964e3714f9530d33ca6dbdf2d8644343b6e1798 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 20 Jun 2024 13:42:04 +0300 Subject: [PATCH] Fix last change * src/xdisp.c (handle_line_prefix): Set the 'align_visually_p' only after pushing the iterator. (pop_it): Reset the 'align_visually_p' flag. (Bug#71605) (cherry picked from commit 74af691b90e69eb70d47782419edfab7d6503dc2) --- src/xdisp.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index 5987813cd28..18ac5b69d7e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7288,6 +7288,7 @@ pop_it (struct it *it) it->bidi_p = p->bidi_p; it->paragraph_embedding = p->paragraph_embedding; it->from_disp_prop_p = p->from_disp_prop_p; + it->align_visually_p = false; if (it->bidi_p) { bidi_pop_it (&it->bidi_it); @@ -24488,17 +24489,14 @@ static void handle_line_prefix (struct it *it) { Lisp_Object prefix; + bool wrap_prop = false; if (it->continuation_lines_width > 0) { prefix = get_line_prefix_it_property (it, Qwrap_prefix); if (NILP (prefix)) prefix = Vwrap_prefix; - /* Interpreting :align-to relative to the beginning of the logical - line effectively renders this feature unusable, so we make an - exception for this use of :align-to. */ - if (!NILP (prefix)) - it->align_visually_p = true; + wrap_prop = true; } else { @@ -24513,6 +24511,11 @@ handle_line_prefix (struct it *it) iterator stack overflows. So, don't wrap the prefix. */ it->line_wrap = TRUNCATE; it->avoid_cursor_p = true; + /* Interpreting :align-to relative to the beginning of the logical + line effectively renders this feature unusable, so we make an + exception for this use of :align-to. */ + if (wrap_prop && CONSP (prefix) && EQ (XCAR (prefix), Qspace)) + it->align_visually_p = true; } } -- 2.39.2