GNU bug report logs - #79241
31.0.50; `vertical-motion' not respecting goal column when there is an overlay that spans multiple virtual lines

Previous Next

Package: emacs;

Reported by: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>

Date: Fri, 15 Aug 2025 08:33:02 UTC

Severity: minor

Found in version 31.0.50

Full log


Message #28 received at 79241 <at> debbugs.gnu.org (full text, mbox):

From: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
To: 79241 <at> debbugs.gnu.org
Cc: Sergio Pastor Pérez <sergio.pastorperez <at> gmail.com>
Subject: [PATCH v2] Fix incorrect handling of overlays in `vertical-motion'
Date: Sun, 24 Aug 2025 13:13:01 +0200
* src/indent.c (vertical-motion): If point is inside an overlay, reset
it to the beginning of line before trying to reach goal column. This
prevents point from being stuck at the beginning of overlay strings
during upward motions.
---
 src/indent.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/indent.c b/src/indent.c
index b4f3c349dc5..01865c1494f 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2506,6 +2506,9 @@ line (if such column exists on that line, that is).  If the line is
 	 an addition to the hscroll amount.  */
       if (!NILP (lcols))
 	{
+	  if (it.method == GET_FROM_STRING)
+	    reseat_at_previous_visible_line_start(&it);
+
 	  move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
 	  /* If we find ourselves in the middle of an overlay string
 	     which includes a newline after current string position,
-- 
2.51.0





This bug report was last modified 5 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.