diff src/ex_cmds.c @ 1185:184d2020d8f1 v7.1a.001

updated for version 7.1a-001
author vimboss
date Sun, 06 May 2007 21:55:31 +0000
parents f9366d458bd0
children 40943ccdf160
line wrap: on
line diff
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3088,6 +3088,9 @@ do_ecmd(fnum, ffname, sfname, eap, newln
     char_u	*cp;
 #endif
     char_u	*command = NULL;
+#ifdef FEAT_SPELL
+    int		did_get_winopts = FALSE;
+#endif
 
     if (eap != NULL)
 	command = eap->do_ecmd_cmd;
@@ -3365,6 +3368,9 @@ do_ecmd(fnum, ffname, sfname, eap, newln
 		 * before, reset the local window options to the global
 		 * values.  Also restores old folding stuff. */
 		get_winopts(buf);
+#ifdef FEAT_SPELL
+		did_get_winopts = TRUE;
+#endif
 
 #ifdef FEAT_AUTOCMD
 	    }
@@ -3640,6 +3646,13 @@ do_ecmd(fnum, ffname, sfname, eap, newln
     }
 #endif
 
+#ifdef FEAT_SPELL
+    /* If the window options were changed may need to set the spell language.
+     * Can only do this after the buffer has been properly setup. */
+    if (did_get_winopts && curwin->w_p_spell && *buf->b_p_spl != NUL)
+	did_set_spelllang(buf);
+#endif
+
     if (command == NULL)
     {
 	if (newcol >= 0)	/* position set by autocommands */