From a9a679b70ee79a68f2865c60572baa8acf6d44a5 Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sat, 12 Jun 1999 03:50:37 +0000 Subject: [PATCH] (compute_motion): Fix boundary case. --- src/indent.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/indent.c b/src/indent.c index 9528894baf2..5e5c1a0a68d 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1418,7 +1418,9 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, /* Skip any number of invisible lines all at once */ do { - pos = find_before_next_newline (pos, to, 1) + 1; + pos = find_before_next_newline (pos, to, 1); + if (pos < to) + pos++; pos_byte = CHAR_TO_BYTE (pos); } while (pos < to -- 2.39.5