}
else
{
- g_chartab[c] = (g_chartab[c] & ~CT_CELL_MASK) + 1;
+ g_chartab[c] = (g_chartab[c] & ~CT_CELL_MASK)
+ + 1;
g_chartab[c] |= CT_PRINT_CHAR;
}
}
}
/*
- * return TRUE if 'c' is a valid file-name character
+ * Return TRUE if 'c' is a valid file-name character as specified with the
+ * 'isfname' option.
* Assume characters above 0x100 are valid (multi-byte).
+ * To be used for commands like "gf".
*/
int
vim_isfilec(int c)
return (c >= 0x100 || (c > 0 && (g_chartab[c] & CT_FNAME_CHAR)));
}
+/*
+ * Return TRUE if 'c' is a valid file-name character, including characters left
+ * out of 'isfname' to make "gf" work, such as comma, space, '@', etc.
+ */
+ int
+vim_is_fname_char(int c)
+{
+ return vim_isfilec(c) || c == ',' || c == ' ' || c == '@';
+}
+
/*
* return TRUE if 'c' is a valid file-name character or a wildcard character
* Assume characters above 0x100 are valid (multi-byte).
int vim_iswordp(char_u *p);
int vim_iswordp_buf(char_u *p, buf_T *buf);
int vim_isfilec(int c);
+int vim_is_fname_char(int c);
int vim_isfilec_or_wc(int c);
int vim_isprintc(int c);
int vim_isprintc_strict(int c);
char_u *s;
for (s = val; *s != NUL; ++s)
- if (!vim_isfilec(*s) && *s != ',' && *s != ' ')
+ if (!vim_is_fname_char(*s))
return FALSE;
return TRUE;
}
call assert_fails('set mkspellmem=1000,50,0', 'E474:')
endfunc
+" '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 = ''
+ delete('Xtest', 'rf')
+enddef
+
" vim: shiftwidth=2 sts=2 expandtab