aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergio Pastor Pérez2025-08-24 20:27:06 +0200
committerEli Zaretskii2025-08-30 12:39:35 +0300
commit8d301906e1f53b366316754d1f3ff2ad7f0f673c (patch)
treeb8ee2a4aadd21c1d331eed19048f4278b7cef508 /src
parent98cd122776e0adddfdc5cd5f23df43c56df35647 (diff)
downloademacs-8d301906e1f53b366316754d1f3ff2ad7f0f673c.tar.gz
emacs-8d301906e1f53b366316754d1f3ff2ad7f0f673c.zip
bug#79241: Fix incorrect handling of overlays in `vertical-motion'
* src/indent.c (vertical-motion): If iterator 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. Copyright-paperwork-exempt: yes
Diffstat (limited to 'src')
-rw-r--r--src/indent.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/indent.c b/src/indent.c
index b4f3c349dc5..95228b26825 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2506,6 +2506,9 @@ buffer, whether or not it is currently displayed in some window. */)
2506 an addition to the hscroll amount. */ 2506 an addition to the hscroll amount. */
2507 if (!NILP (lcols)) 2507 if (!NILP (lcols))
2508 { 2508 {
2509 if (it.method == GET_FROM_STRING && !NILP (it.from_overlay))
2510 reseat_at_previous_visible_line_start(&it);
2511
2509 move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X); 2512 move_it_in_display_line (&it, ZV, first_x + to_x, MOVE_TO_X);
2510 /* If we find ourselves in the middle of an overlay string 2513 /* If we find ourselves in the middle of an overlay string
2511 which includes a newline after current string position, 2514 which includes a newline after current string position,