diff src/spell.c @ 857:b933657f7c9d

updated for version 7.0g01
author vimboss
date Tue, 02 May 2006 22:08:30 +0000
parents d3bbb5dd3913
children 99305c4c42d4
line wrap: on
line diff
--- a/src/spell.c
+++ b/src/spell.c
@@ -2131,8 +2131,6 @@ spell_move_to(wp, dir, allwords, curline
 		/* We found a bad word.  Check the attribute. */
 		if (allwords || attr == HLF_SPB)
 		{
-		    found_one = TRUE;
-
 		    /* When searching forward only accept a bad word after
 		     * the cursor. */
 		    if (dir == BACKWARD
@@ -2149,6 +2147,8 @@ spell_move_to(wp, dir, allwords, curline
 			    col = (int)(p - buf);
 			    (void)syn_get_id(wp, lnum, (colnr_T)col,
 						       FALSE, &can_spell);
+			    if (!can_spell)
+				attr = HLF_COUNT;
 			}
 			else
 #endif
@@ -2156,6 +2156,7 @@ spell_move_to(wp, dir, allwords, curline
 
 			if (can_spell)
 			{
+			    found_one = TRUE;
 			    found_pos.lnum = lnum;
 			    found_pos.col = (int)(p - buf);
 #ifdef FEAT_VIRTUALEDIT
@@ -2177,6 +2178,8 @@ spell_move_to(wp, dir, allwords, curline
 			    found_len = len;
 			}
 		    }
+		    else
+			found_one = TRUE;
 		}
 	    }