aboutsummaryrefslogtreecommitdiffstats
path: root/src/indent.c
diff options
context:
space:
mode:
authorEli Zaretskii2012-11-21 21:28:14 +0200
committerEli Zaretskii2012-11-21 21:28:14 +0200
commitcb5867b1f8af39ffd70767fc06fd364bca67e968 (patch)
treed4be99e4b2871e16dec20ae03bcca1770aea8451 /src/indent.c
parent365fc14aa4c5033422481d9145cba015821df052 (diff)
downloademacs-cb5867b1f8af39ffd70767fc06fd364bca67e968.tar.gz
emacs-cb5867b1f8af39ffd70767fc06fd364bca67e968.zip
Fix bug #12930 with vertical-motion through a display string.
src/indent.c (Fvertical_motion): If the starting position is covered by a display string, return to one position before that, to avoid overshooting it inside move_it_to.
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c
index bbc944d2518..33322287c9d 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2057,7 +2057,13 @@ whether or not it is currently displayed in some window. */)
2057 comment said this is "so we don't move too far" (2005-01-19 2057 comment said this is "so we don't move too far" (2005-01-19
2058 checkin by kfs). But this does nothing useful that I can 2058 checkin by kfs). But this does nothing useful that I can
2059 tell, and it causes Bug#2694 . -- cyd */ 2059 tell, and it causes Bug#2694 . -- cyd */
2060 move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); 2060 /* When the position we started from is covered by a display
2061 string, move_it_to will overshoot it, while vertical-motion
2062 wants to put the cursor _before_ the display string. So in
2063 that case, we move to buffer position before the display
2064 string, and avoid overshooting. */
2065 move_it_to (&it, disp_string_at_start_p ? PT - 1 : PT,
2066 -1, -1, -1, MOVE_TO_POS);
2061 2067
2062 /* IT may move too far if truncate-lines is on and PT lies 2068 /* IT may move too far if truncate-lines is on and PT lies
2063 beyond the right margin. IT may also move too far if the 2069 beyond the right margin. IT may also move too far if the