diff options
author | Eli Zaretskii <eliz@gnu.org> | 2012-11-21 21:28:14 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2012-11-21 21:28:14 +0200 |
commit | cb5867b1f8af39ffd70767fc06fd364bca67e968 (patch) | |
tree | d4be99e4b2871e16dec20ae03bcca1770aea8451 | |
parent | 365fc14aa4c5033422481d9145cba015821df052 (diff) | |
download | emacs-cb5867b1f8af39ffd70767fc06fd364bca67e968.tar.gz |
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.
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/indent.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f7cb0fe850f..f760adf313f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-11-21 Eli Zaretskii <eliz@gnu.org> + + * 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. (Bug#12930) + 2012-11-20 Daniel Colascione <dancol@dancol.org> * w32fns.c (Fx_file_dialog): 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. */) comment said this is "so we don't move too far" (2005-01-19 checkin by kfs). But this does nothing useful that I can tell, and it causes Bug#2694 . -- cyd */ - move_it_to (&it, PT, -1, -1, -1, MOVE_TO_POS); + /* When the position we started from is covered by a display + string, move_it_to will overshoot it, while vertical-motion + wants to put the cursor _before_ the display string. So in + that case, we move to buffer position before the display + string, and avoid overshooting. */ + move_it_to (&it, disp_string_at_start_p ? PT - 1 : PT, + -1, -1, -1, MOVE_TO_POS); /* IT may move too far if truncate-lines is on and PT lies beyond the right margin. IT may also move too far if the |