diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-04 13:01:48 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-04 13:01:48 +0100 |
commit | bc49c5f48f89c2d6f4d88ee77f44a11d68293be3 (patch) | |
tree | 810e9e2809e1e8cdfb4cc088ad1127bc141e7bb8 /src/charset.c | |
parent | db7a88db8b52508d3df6d5947f7c4f3ef05d5f62 (diff) | |
download | vim-git-bc49c5f48f89c2d6f4d88ee77f44a11d68293be3.tar.gz |
patch 9.0.0138: not enough characters accepted for 'spellfile'v9.0.0138
Problem: Not enough characters accepted for 'spellfile'.
Solution: Add vim_is_fname_char() and use it for 'spellfile'.
Diffstat (limited to 'src/charset.c')
-rw-r--r-- | src/charset.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/charset.c b/src/charset.c index c2137049b..37c333622 100644 --- a/src/charset.c +++ b/src/charset.c @@ -225,7 +225,8 @@ buf_init_chartab( } 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; } } @@ -846,8 +847,10 @@ vim_iswordp_buf(char_u *p, buf_T *buf) } /* - * 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) @@ -856,6 +859,16 @@ vim_isfilec(int c) } /* + * 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). * Explicitly interpret ']' as a wildcard character as mch_has_wildcard("]") |