updated for version 7.0137
diff --git a/src/edit.c b/src/edit.c
index b31177c..f399f30 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4810,7 +4810,7 @@
 {
     pos_T	tpos = curwin->w_cursor;
 
-    spell_bad_len = spell_move_to(BACKWARD, TRUE, TRUE);
+    spell_bad_len = spell_move_to(curwin, BACKWARD, TRUE, TRUE, NULL);
     if (curwin->w_cursor.col != tpos.col)
 	start_arrow(&tpos);
 }
diff --git a/src/eval.c b/src/eval.c
index c934553..0190071 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -13756,7 +13756,7 @@
 
 #ifdef FEAT_SYN_HL
     /* Find the start and length of the badly spelled word. */
-    len = spell_move_to(FORWARD, TRUE, TRUE);
+    len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL);
     if (len != 0)
 	rettv->vval.v_string = vim_strnsave(ml_get_cursor(), len);
 #endif
@@ -14208,7 +14208,7 @@
 
     if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
 	    && col >= 0 && col < (long)STRLEN(ml_get(lnum)))
-	id = syn_get_id(lnum, (colnr_T)col, trans, NULL);
+	id = syn_get_id(curwin, lnum, (colnr_T)col, trans, NULL);
 #endif
 
     rettv->vval.v_number = id;
diff --git a/src/hardcopy.c b/src/hardcopy.c
index 77ee4b5..5cfeb8b 100644
--- a/src/hardcopy.c
+++ b/src/hardcopy.c
@@ -876,7 +876,7 @@
 	 */
 	if (psettings->do_syntax)
 	{
-	    id = syn_get_id(ppos->file_line, col, 1, NULL);
+	    id = syn_get_id(curwin, ppos->file_line, col, 1, NULL);
 	    if (id > 0)
 		id = syn_get_final_id(id);
 	    else
diff --git a/src/proto/spell.pro b/src/proto/spell.pro
index 3c4c798..2adc137 100644
--- a/src/proto/spell.pro
+++ b/src/proto/spell.pro
@@ -1,6 +1,6 @@
 /* spell.c */
 int spell_check __ARGS((win_T *wp, char_u *ptr, int *attrp, int *capcol));
-int spell_move_to __ARGS((int dir, int allwords, int curline));
+int spell_move_to __ARGS((win_T *wp, int dir, int allwords, int curline, int *attrp));
 void spell_cat_line __ARGS((char_u *buf, char_u *line, int maxlen));
 char_u *did_set_spelllang __ARGS((buf_T *buf));
 void spell_free_all __ARGS((void));
@@ -17,6 +17,7 @@
 void spell_suggest_list __ARGS((garray_T *gap, char_u *word, int maxcount, int need_cap));
 char_u *eval_soundfold __ARGS((char_u *word));
 void ex_spelldump __ARGS((exarg_T *eap));
+char_u *spell_to_word_end __ARGS((char_u *start, buf_T *buf));
 int spell_word_start __ARGS((int startcol));
 int expand_spelling __ARGS((linenr_T lnum, int col, char_u *pat, char_u ***matchp));
 /* vim: set ft=c : */
diff --git a/src/screen.c b/src/screen.c
index b3dbe01..ba345ae 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2916,6 +2916,31 @@
 	if (wp->w_p_wrap)
 	    need_showbreak = TRUE;
 #endif
+#ifdef FEAT_SYN_HL
+	/* When spell checking a word we need to figure out the start of the
+	 * word and if it's badly spelled or not. */
+	if (has_spell)
+	{
+	    int		len;
+
+	    pos = wp->w_cursor;
+	    wp->w_cursor.lnum = lnum;
+	    wp->w_cursor.col = ptr - line;
+	    len = spell_move_to(wp, FORWARD, TRUE, TRUE, &spell_attr);
+	    if (len == 0 || wp->w_cursor.col > ptr - line)
+	    {
+		/* no bad word found at line start, don't check until end of a
+		 * word */
+		spell_attr = 0;
+		word_end = spell_to_word_end(ptr, wp->w_buffer) - line + 1;
+	    }
+	    else
+		/* bad word found, use attributes until end of word */
+		word_end = wp->w_cursor.col + len + 1;
+
+	    wp->w_cursor = pos;
+	}
+#endif
     }
 
     /*
diff --git a/src/syntax.c b/src/syntax.c
index aa393d7..65a7926 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -5992,7 +5992,8 @@
  * Function called for expression evaluation: get syntax ID at file position.
  */
     int
-syn_get_id(lnum, col, trans, spellp)
+syn_get_id(wp, lnum, col, trans, spellp)
+    win_T	*wp;
     long	lnum;
     colnr_T	col;
     int		trans;	    /* remove transparancy */
@@ -6000,10 +6001,10 @@
 {
     /* When the position is not after the current position and in the same
      * line of the same buffer, need to restart parsing. */
-    if (curwin->w_buffer != syn_buf
+    if (wp->w_buffer != syn_buf
 	    || lnum != current_lnum
 	    || col < current_col)
-	syntax_start(curwin, lnum);
+	syntax_start(wp, lnum);
 
     (void)get_syntax_attr(col, spellp);
 
diff --git a/src/version.h b/src/version.h
index f1ce02b..13e4071 100644
--- a/src/version.h
+++ b/src/version.h
@@ -36,5 +36,5 @@
 #define VIM_VERSION_NODOT	"vim70aa"
 #define VIM_VERSION_SHORT	"7.0aa"
 #define VIM_VERSION_MEDIUM	"7.0aa ALPHA"
-#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 25)"
-#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 25, compiled "
+#define VIM_VERSION_LONG	"VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 26)"
+#define VIM_VERSION_LONG_DATE	"VIM - Vi IMproved 7.0aa ALPHA (2005 Aug 26, compiled "