0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.1.0803: tests: no error check when setting global 'isk'

Problem:  tests: no error check when setting global 'isk'
Solution: also parse and check global 'isk' value (Milly)

closes: #15915

Signed-off-by: Milly <milly.ca@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Milly
2024-10-22 22:27:19 +02:00
committed by Christian Brabandt
parent 142cad1f88
commit 5e7a6a4a10
7 changed files with 159 additions and 103 deletions

View File

@@ -2774,6 +2774,25 @@ did_set_imactivatekey(optset_T *args UNUSED)
}
#endif
/*
* The 'iskeyword' option is changed.
*/
char *
did_set_iskeyword(optset_T *args)
{
char_u **varp = (char_u **)args->os_varp;
if (varp == &p_isk) // only check for global-value
{
if (check_isopt(*varp) == FAIL)
return e_invalid_argument;
}
else // fallthrough for local-value
return did_set_isopt(args);
return NULL;
}
/*
* The 'isident' or the 'iskeyword' or the 'isprint' or the 'isfname' option is
* changed.
@@ -2781,7 +2800,7 @@ did_set_imactivatekey(optset_T *args UNUSED)
char *
did_set_isopt(optset_T *args)
{
// 'isident', 'iskeyword', 'isprint or 'isfname' option: refill g_chartab[]
// 'isident', 'iskeyword', 'isprint' or 'isfname' option: refill g_chartab[]
// If the new option is invalid, use old value.
// 'lisp' option: refill g_chartab[] for '-' char.
if (init_chartab() == FAIL)