aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/optionstr.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-10-24 06:10:06 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-10-24 06:56:12 +0800
commit3d2aca83de7f57ad0ba1c67acb87e55876569d0a (patch)
tree45cf0b6775f65842e4d68c8df5d0192246b4f87a /src/nvim/optionstr.c
parent6d2cf5ad3112d12b4b55df9df1e0921086b54fec (diff)
downloadrneovim-3d2aca83de7f57ad0ba1c67acb87e55876569d0a.tar.gz
rneovim-3d2aca83de7f57ad0ba1c67acb87e55876569d0a.tar.bz2
rneovim-3d2aca83de7f57ad0ba1c67acb87e55876569d0a.zip
vim-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: vim/vim#15915 https://github.com/vim/vim/commit/5e7a6a4a106923e45c67dae6810e4c9753f88025 Co-authored-by: Milly <milly.ca@gmail.com>
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r--src/nvim/optionstr.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index c801ec0a26..f9be1be3d2 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -1572,12 +1572,28 @@ int expand_set_inccommand(optexpand_T *args, int *numMatches, char ***matches)
matches);
}
+/// The 'iskeyword' option is changed.
+const char *did_set_iskeyword(optset_T *args)
+{
+ char **varp = (char **)args->os_varp;
+
+ if (varp == &p_isk) { // only check for global-value
+ if (check_isopt(*varp) == FAIL) {
+ return e_invarg;
+ }
+ } 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.
const char *did_set_isopt(optset_T *args)
{
buf_T *buf = (buf_T *)args->os_buf;
- // '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 (buf_init_chartab(buf, true) == FAIL) {