summaryrefslogtreecommitdiff
path: root/src/indent.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-12-18 12:26:17 +0200
committerEli Zaretskii <eliz@gnu.org>2015-12-18 12:26:17 +0200
commitfb2eaf0ffc213fac170cff4814b7c93bd0c44c20 (patch)
tree6dc310bb5da12045f7f1023180b0a1ccafd3845e /src/indent.c
parenta64b71e3cba8bdc11222140fa69fb8c86ce5ca30 (diff)
downloademacs-fb2eaf0ffc213fac170cff4814b7c93bd0c44c20.tar.gz
emacs-fb2eaf0ffc213fac170cff4814b7c93bd0c44c20.tar.bz2
emacs-fb2eaf0ffc213fac170cff4814b7c93bd0c44c20.zip
Fix vertical-motion in tabulated-list mode
* src/indent.c (Fvertical_motion): When moving from line beginning to point under line truncation, assume overshoot by one line only if point actually lies beyond the window's right margin. (Bug#22194)
Diffstat (limited to 'src/indent.c')
-rw-r--r--src/indent.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/indent.c b/src/indent.c
index 04837f8f513..33bf424b344 100644
--- a/src/indent.c
+++ b/src/indent.c
@@ -2080,11 +2080,7 @@ whether or not it is currently displayed in some window. */)
}
else
it_overshoot_count =
- (!(it.method == GET_FROM_IMAGE
- || it.method == GET_FROM_STRETCH)
- /* We will overshoot if lines are truncated and PT lies
- beyond the right margin of the window. */
- || it.line_wrap == TRUNCATE);
+ !(it.method == GET_FROM_IMAGE || it.method == GET_FROM_STRETCH);
if (start_x_given)
{
@@ -2142,6 +2138,11 @@ 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
+ 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 = 1;
if (it_overshoot_count > 0)
move_it_by_lines (&it, -it_overshoot_count);