From cb7a3f4e893e03c7f33f21523ce59912691fdb9e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 19 Jan 2026 16:20:39 +0200 Subject: [PATCH] Fix vertical cursor motion across overlay strings * src/indent.c (Fvertical_motion): Fix vertical cursor motion when a screen line begins with an overlay string. (Bug#80223) --- src/indent.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/indent.c b/src/indent.c index 427350020fd..3443ddb8c73 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2506,7 +2506,10 @@ buffer, whether or not it is currently displayed in some window. */) an addition to the hscroll amount. */ if (!NILP (lcols)) { - if (it.method == GET_FROM_STRING && !NILP (it.from_overlay)) + /* Start at beginning of line if inside an overlay string, to + avoid becoming stuck at the beginning of the overlay string. */ + if (it.continuation_lines_width <= 0 /* not in continuation line */ + && it.method == GET_FROM_STRING && !NILP (it.from_overlay)) reseat_at_previous_visible_line_start(&it); move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);