summaryrefslogtreecommitdiff
path: root/src/spell.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-25 14:21:10 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-25 14:21:10 +0100
commitd3f78dc9ebd729475a7f24a50a91112e300d5ac9 (patch)
tree00afd985ba5dd028f17ce94bd402e43070f6e5c0 /src/spell.c
parent3834e3d039777e0144914a86289870bee147c0a2 (diff)
downloadvim-git-d3f78dc9ebd729475a7f24a50a91112e300d5ac9.tar.gz
patch 8.0.0364: ]s does not move cursor with two spell errors in one linev8.0.0364
Problem: ]s does not move cursor with two spell errors in one line. (Manuel Ortega) Solution: Don't stop search immediately when wrapped, search the line first. (Ken Takata) Add a test.
Diffstat (limited to 'src/spell.c')
-rw-r--r--src/spell.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/spell.c b/src/spell.c
index 91a48fa77..f124ef21d 100644
--- a/src/spell.c
+++ b/src/spell.c
@@ -1734,14 +1734,14 @@ spell_move_to(
if (curline)
break; /* only check cursor line */
+ /* If we are back at the starting line and searched it again there
+ * is no match, give up. */
+ if (lnum == wp->w_cursor.lnum && wrapped)
+ break;
+
/* Advance to next line. */
if (dir == BACKWARD)
{
- /* If we are back at the starting line and searched it again there
- * is no match, give up. */
- if (lnum == wp->w_cursor.lnum && wrapped)
- break;
-
if (lnum > 1)
--lnum;
else if (!p_ws)
@@ -1775,7 +1775,7 @@ spell_move_to(
/* If we are back at the starting line and there is no match then
* give up. */
- if (lnum == wp->w_cursor.lnum && (!found_one || wrapped))
+ if (lnum == wp->w_cursor.lnum && !found_one)
break;
/* Skip the characters at the start of the next line that were