neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit ab98c5b5a0fdc9aad87feaf230239454f0a5e532
parent 289380bc40c7932c0fdfb406ec37a68745ba1cc9
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sat,  5 Oct 2024 07:20:38 +0800

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>
Diffstat:
Msrc/nvim/option.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 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; }