summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2017-08-13 17:49:07 +0300
committerEli Zaretskii <eliz@gnu.org>2017-08-13 17:49:07 +0300
commit28a5b8adcc1cf5e70b06749c73645f4caa9d0b37 (patch)
tree0c9dd3afc6d1d1d613bdf9a74978bda5bf6626a9 /src/indent.c
parent8c8be4f8f439123859bf20f4d46055fa6c81f2e8 (diff)
downloademacs-28a5b8adcc1cf5e70b06749c73645f4caa9d0b37.tar.gz
Fix vertical cursor motion across too wide images
* src/indent.c (Fvertical_motion): If lines are truncated and we end up beyond the right margin of the window, don't assume we are in the next screen line, unless VPOS actually says so. (Bug#28071)
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/indent.c b/src/indent.c
index 4c6dacd2042..d76ac028d5b 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2229,10 +2229,10 @@ whether or not it is currently displayed in some window. */)
screen lines we need to backtrack. */
it_overshoot_count = it.vpos;
}
- /* We will overshoot if lines are truncated and point lies
+ /* We might overshoot if lines are truncated and point lies
beyond the right margin of the window. */
if (it.line_wrap == TRUNCATE && it.current_x >= it.last_visible_x
- && it_overshoot_count == 0)
+ && it_overshoot_count == 0 && it.vpos > 0)
it_overshoot_count = 1;
if (it_overshoot_count > 0)
move_it_by_lines (&it, -it_overshoot_count);