diff options
author | Eli Zaretskii <[email protected]> | 2013-04-13 11:54:02 +0300 |
---|---|---|
committer | Eli Zaretskii <[email protected]> | 2013-04-13 11:54:02 +0300 |
commit | 29b79ba19785cf3d5bbb3779779ca3a7714ee2e1 (patch) | |
tree | edea1d94bb03e580429cff55b80e72980390f225 /src | |
parent | 011cddd649d81956ce13b9325b059dac78e61c4d (diff) |
Fix vertical cursor motion when there are overlay strings at EOL.
src/indent.c (Fvertical_motion): Don't consider display strings on
overlay strings as display strings on the buffer position we
started from. This prevents vertical cursor motion from jumping
more than one line when there's an overlay string with a display
property at end of line.
Reported by Karl Chen <[email protected]> in
http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 10 | ||||
-rw-r--r-- | src/indent.c | 8 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 08f33eb7d0..af2d38d2e8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2013-04-13 Eli Zaretskii <[email protected]> + + * indent.c (Fvertical_motion): Don't consider display strings on + overlay strings as display strings on the buffer position we + started from. This prevents vertical cursor motion from jumping + more than one line when there's an overlay string with a display + property at end of line. + Reported by Karl Chen <[email protected]> in + http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html. + 2013-04-12 Stefan Monnier <[email protected]> * window.c (select_window): `record_buffer' even if window is diff --git a/src/indent.c b/src/indent.c index 67796ab8a8..47358e17db 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2006,11 +2006,15 @@ whether or not it is currently displayed in some window. */) const char *s = SSDATA (it.string); const char *e = s + SBYTES (it.string); + disp_string_at_start_p = /* If it.area is anything but TEXT_AREA, we need not bother about the display string, as it doesn't affect cursor positioning. */ - disp_string_at_start_p = - it.string_from_display_prop_p && it.area == TEXT_AREA; + it.area == TEXT_AREA + && it.string_from_display_prop_p + /* A display string on anything but buffer text (e.g., on + an overlay string) doesn't affect cursor positioning. */ + && (it.sp > 0 && it.stack[it.sp - 1].method == GET_FROM_BUFFER); while (s < e) { if (*s++ == '\n') |