updated for version 7.0070
diff --git a/src/option.c b/src/option.c
index cf5e9b4..ee33df9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -5658,10 +5658,20 @@
#endif
#ifdef FEAT_SYN_HL
- /* When 'spelllang' is set, load the wordlists. */
+ /* When 'spelllang' is set and there is a window for this buffer in which
+ * 'spell' is set load the wordlists. */
else if (varp == &(curbuf->b_p_spl))
{
- errmsg = did_set_spelllang(curbuf);
+ win_T *wp;
+
+ FOR_ALL_WINDOWS(wp)
+ if (wp->w_buffer == curbuf && wp->w_p_spell)
+ {
+ errmsg = did_set_spelllang(curbuf);
+# ifdef FEAT_WINDOWS
+ break;
+# endif
+ }
}
#endif
@@ -6636,6 +6646,19 @@
}
#endif
+#ifdef FEAT_SYN_HL
+ /* 'spell' */
+ else if ((int *)varp == &curwin->w_p_spell)
+ {
+ if (curwin->w_p_spell)
+ {
+ char_u *errmsg = did_set_spelllang(curbuf);
+ if (errmsg != NULL)
+ EMSG(_(errmsg));
+ }
+ }
+#endif
+
#ifdef FEAT_FKMAP
else if ((int *)varp == &p_altkeymap)
{
@@ -8586,7 +8609,6 @@
/* Don't copy 'syntax', it must be set */
buf->b_p_syn = empty_option;
buf->b_p_spl = vim_strsave(p_spl);
- did_set_spelllang(buf);
#endif
#if defined(FEAT_CINDENT) && defined(FEAT_EVAL)
buf->b_p_inde = vim_strsave(p_inde);