(void)spell_check_msm();
(void)spell_check_sps();
(void)compile_cap_prog(curwin->w_s);
- (void)did_set_spell_option(TRUE);
+ (void)did_set_spell_option();
#endif
// set cedit_key
(void)did_set_cedit(NULL);
// If there is a window for this buffer in which 'spell' is set load the
// wordlists.
- return did_set_spell_option(TRUE);
+ return did_set_spell_option();
}
/*
// If there is a window for this buffer in which 'spell' is set load the
// wordlists.
- return did_set_spell_option(FALSE);
+ return did_set_spell_option();
}
/*
int expand_spelling(linenr_T lnum, char_u *pat, char_u ***matchp);
int valid_spelllang(char_u *val);
int valid_spellfile(char_u *val);
-char *did_set_spell_option(int is_spellfile);
+char *did_set_spell_option(void);
char *compile_cap_prog(synblock_T *synblock);
/* vim: set ft=c : */
else
{
// One entry in 'spellfile'.
- copy_option_part(&spf, spf_name, MAXPATHL - 5, ",");
+ copy_option_part(&spf, spf_name, MAXPATHL - 4, ",");
STRCAT(spf_name, ".spl");
// If it was already found above then skip it.
int
valid_spellfile(char_u *val)
{
- char_u *s;
+ char_u spf_name[MAXPATHL];
+ char_u *spf;
+ char_u *s;
+ int l;
- for (s = val; *s != NUL; ++s)
- if (!vim_is_fname_char(*s))
+ spf = val;
+ while (*spf != NUL)
+ {
+ l = copy_option_part(&spf, spf_name, MAXPATHL, ",");
+ if (l >= MAXPATHL - 4 || l < 4
+ || STRCMP(spf_name + l - 4, ".add") != 0)
return FALSE;
+ for (s = spf_name; *s != NUL; ++s)
+ if (!vim_is_fname_char(*s))
+ return FALSE;
+ }
return TRUE;
}
* Return an error message or NULL for success.
*/
char *
-did_set_spell_option(int is_spellfile)
+did_set_spell_option(void)
{
char *errmsg = NULL;
win_T *wp;
- int l;
-
- if (is_spellfile)
- {
- l = (int)STRLEN(curwin->w_s->b_p_spf);
- if (l > 0 && (l < 4
- || STRCMP(curwin->w_s->b_p_spf + l - 4, ".add") != 0))
- errmsg = e_invalid_argument;
- }
-
- if (errmsg != NULL)
- return errmsg;
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer == curbuf && wp->w_p_spell)
\ 'sessionoptions': [['', 'blank', 'help,options,slash'], ['xxx']],
\ 'showcmdloc': [['last', 'statusline', 'tabline'], ['xxx']],
\ 'signcolumn': [['', 'auto', 'no'], ['xxx', 'no,yes']],
- \ 'spellfile': [['', 'file.en.add', '/tmp/dir\ with\ space/en.utf-8.add'], ['xxx', '/tmp/file']],
+ \ 'spellfile': [['', 'file.en.add', 'xxx.en.add,yyy.gb.add,zzz.ja.add',
+ \ '/tmp/dir\ with\ space/en.utf-8.add',
+ \ '/tmp/dir\\,with\\,comma/en.utf-8.add'],
+ \ ['xxx', '/tmp/file', ',file.en.add', 'xxx,yyy.en.add',
+ \ 'xxx.en.add,yyy,zzz.ja.add']],
\ 'spelllang': [['', 'xxx', 'sr@latin'], ['not&lang', "that\\\rthere"]],
\ 'spelloptions': [['', 'camel'], ['xxx']],
\ 'spellsuggest': [['', 'best', 'double,33'], ['xxx']],
" 'spellfile' accepts '@' on top of 'isfname'.
def Test_spellfile_allow_at_character()
mkdir('Xtest/the foo@bar,dir', 'p')
- &spellfile = './Xtest/the foo@bar,dir/Xspellfile.add'
+ &spellfile = './Xtest/the foo@bar\,dir/Xspellfile.add'
&spellfile = ''
delete('Xtest', 'rf')
enddef
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 783,
/**/
782,
/**/