Mercurial > vim
diff src/option.c @ 323:03b3684919e3 v7.0084
updated for version 7.0084
author | vimboss |
---|---|
date | Mon, 13 Jun 2005 22:28:56 +0000 |
parents | bb9041b0ad81 |
children | 7033303ea0c0 |
line wrap: on
line diff
--- a/src/option.c +++ b/src/option.c @@ -5683,20 +5683,32 @@ did_set_string_option(opt_idx, varp, new #endif #ifdef FEAT_SYN_HL - /* 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)) + /* When 'spelllang' or 'spellfile' 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) || varp == &(curbuf->b_p_spf)) { win_T *wp; - - FOR_ALL_WINDOWS(wp) - if (wp->w_buffer == curbuf && wp->w_p_spell) - { - errmsg = did_set_spelllang(curbuf); + int l; + + if (varp == &(curbuf->b_p_spf)) + { + l = STRLEN(curbuf->b_p_spf); + if (l > 0 && (l < 4 || STRCMP(curbuf->b_p_spf + l - 4, + ".add") != 0)) + errmsg = e_invarg; + } + + if (errmsg == NULL) + { + FOR_ALL_WINDOWS(wp) + if (wp->w_buffer == curbuf && wp->w_p_spell) + { + errmsg = did_set_spelllang(curbuf); # ifdef FEAT_WINDOWS - break; + break; # endif - } + } + } } #endif