diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-10-05 07:20:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-05 07:20:38 +0800 |
commit | ab98c5b5a0fdc9aad87feaf230239454f0a5e532 (patch) | |
tree | a5a0a354056225acb23e8fbbfa0fc4dcdfd09bb6 | |
parent | 289380bc40c7932c0fdfb406ec37a68745ba1cc9 (diff) | |
download | rneovim-ab98c5b5a0fdc9aad87feaf230239454f0a5e532.tar.gz rneovim-ab98c5b5a0fdc9aad87feaf230239454f0a5e532.tar.bz2 rneovim-ab98c5b5a0fdc9aad87feaf230239454f0a5e532.zip |
vim-patch:9.1.0758: it's possible to set an invalid key to 'wildcharm' (#30662)
Problem: it's possible to set an invalid key to 'wildcharm'
Solution: error out, if the 'wildcharm' value is an invalid key
(Milly)
closes: vim/vim#15787
https://github.com/vim/vim/commit/40c6babc1789aceb241b23bab76eea16da37e33d
Co-authored-by: Milly <milly.ca@gmail.com>
-rw-r--r-- | src/nvim/option.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index aac15e220a..72b633ceb2 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -1216,8 +1216,9 @@ static OptVal get_option_newval(OptIndex opt_idx, int opt_flags, set_prefix_T pr // Different ways to set a number option: // & set to default value // < set to global value - // <xx> accept special key codes for 'wildchar' - // c accept any non-digit for 'wildchar' + // <xx> accept special key codes for 'wildchar' or 'wildcharm' + // ^x accept ctrl key codes for 'wildchar' or 'wildcharm' + // c accept any non-digit for 'wildchar' or 'wildcharm' // [-]0-9 set number // other error arg++; @@ -1239,7 +1240,7 @@ static OptVal get_option_newval(OptIndex opt_idx, int opt_flags, set_prefix_T pr || (*arg != NUL && (!arg[1] || ascii_iswhite(arg[1])) && !ascii_isdigit(*arg)))) { newval_num = string_to_key(arg); - if (newval_num == 0 && (OptInt *)varp != &p_wcm) { + if (newval_num == 0) { *errmsg = e_invarg; return newval; } |