diff options
| -rw-r--r-- | src/indent.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/indent.c b/src/indent.c index 507b8e36cbe..66392353828 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -997,6 +997,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 997 | { | 997 | { |
| 998 | while (pos == next_boundary) | 998 | while (pos == next_boundary) |
| 999 | { | 999 | { |
| 1000 | int newpos; | ||
| 1001 | |||
| 1000 | /* If the caller says that the screen position came from an earlier | 1002 | /* If the caller says that the screen position came from an earlier |
| 1001 | call to compute_motion, then we've already accounted for the | 1003 | call to compute_motion, then we've already accounted for the |
| 1002 | overlay strings at point. This is only true the first time | 1004 | overlay strings at point. This is only true the first time |
| @@ -1020,7 +1022,12 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1020 | (but not necessarily all that there are here), | 1022 | (but not necessarily all that there are here), |
| 1021 | and store in next_boundary the next position where | 1023 | and store in next_boundary the next position where |
| 1022 | we need to call skip_invisible. */ | 1024 | we need to call skip_invisible. */ |
| 1023 | pos = skip_invisible (pos, &next_boundary, to, window); | 1025 | newpos = skip_invisible (pos, &next_boundary, to, window); |
| 1026 | |||
| 1027 | if (newpos >= to) | ||
| 1028 | goto after_loop; | ||
| 1029 | |||
| 1030 | pos = newpos; | ||
| 1024 | } | 1031 | } |
| 1025 | 1032 | ||
| 1026 | /* Handle right margin. */ | 1033 | /* Handle right margin. */ |
| @@ -1361,6 +1368,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, | |||
| 1361 | } | 1368 | } |
| 1362 | } | 1369 | } |
| 1363 | 1370 | ||
| 1371 | after_loop: | ||
| 1372 | |||
| 1364 | /* Remember any final width run in the cache. */ | 1373 | /* Remember any final width run in the cache. */ |
| 1365 | if (current_buffer->width_run_cache | 1374 | if (current_buffer->width_run_cache |
| 1366 | && width_run_width == 1 | 1375 | && width_run_width == 1 |