forked from aniani/vim
patch 9.1.0758: it's possible to set an invalid key to 'wildcharm'
Problem: it's possible to set an invalid key to 'wildcharm' Solution: error out, if the 'wildcharm' value is an invalid key (Milly) closes: #15787 Signed-off-by: Milly <milly.ca@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
60310a4b26
commit
40c6babc17
11
src/option.c
11
src/option.c
@@ -2251,10 +2251,11 @@ do_set_option_numeric(
|
|||||||
* Different ways to set a number option:
|
* Different ways to set a number option:
|
||||||
* & set to default value
|
* & set to default value
|
||||||
* < set to global value
|
* < set to global value
|
||||||
* <xx> accept special key codes for 'wildchar'
|
* <xx> accept special key codes for 'wildchar' or 'wildcharm'
|
||||||
* c accept any non-digit for 'wildchar'
|
* ^x accept ctrl key codes for 'wildchar' or 'wildcharm'
|
||||||
* [-]0-9 set number
|
* c accept any non-digit for 'wildchar' or 'wildcharm'
|
||||||
* other error
|
* [-]0-9 set number
|
||||||
|
* other error
|
||||||
*/
|
*/
|
||||||
++arg;
|
++arg;
|
||||||
if (nextchar == '&')
|
if (nextchar == '&')
|
||||||
@@ -2281,7 +2282,7 @@ do_set_option_numeric(
|
|||||||
&& !VIM_ISDIGIT(*arg))))
|
&& !VIM_ISDIGIT(*arg))))
|
||||||
{
|
{
|
||||||
value = string_to_key(arg, FALSE);
|
value = string_to_key(arg, FALSE);
|
||||||
if (value == 0 && (long *)varp != &p_wcm)
|
if (value == 0)
|
||||||
{
|
{
|
||||||
errmsg = e_invalid_argument;
|
errmsg = e_invalid_argument;
|
||||||
goto skip;
|
goto skip;
|
||||||
|
@@ -7,6 +7,8 @@ if 1
|
|||||||
|
|
||||||
set nomore
|
set nomore
|
||||||
|
|
||||||
|
const K_KENTER = -16715
|
||||||
|
|
||||||
" The terminal size is restored at the end.
|
" The terminal size is restored at the end.
|
||||||
" Clear out t_WS, we don't want to resize the actual terminal.
|
" Clear out t_WS, we don't want to resize the actual terminal.
|
||||||
let script = [
|
let script = [
|
||||||
@@ -55,7 +57,10 @@ let test_values = {
|
|||||||
\ 'updatecount': [[0, 1, 8, 9999], [-1]],
|
\ 'updatecount': [[0, 1, 8, 9999], [-1]],
|
||||||
\ 'updatetime': [[0, 1, 8, 9999], [-1]],
|
\ 'updatetime': [[0, 1, 8, 9999], [-1]],
|
||||||
\ 'verbose': [[-1, 0, 1, 8, 9999], []],
|
\ 'verbose': [[-1, 0, 1, 8, 9999], []],
|
||||||
\ 'wildcharm': [[-1, 0, 100], []],
|
\ 'wildchar': [[-1, 0, 100, 'x', '^Y', '<Esc>', '<t_xx>'],
|
||||||
|
\ ['', 'xxx', '<xxx>', '<Esc', '<C-C>', '<NL>', '<CR>', K_KENTER]],
|
||||||
|
\ 'wildcharm': [[-1, 0, 100, 'x', '^Y', '<Esc>'],
|
||||||
|
\ ['', 'xxx', '<xxx>', '<Esc', '<C-C>', '<NL>', '<CR>', K_KENTER]],
|
||||||
\ 'winheight': [[1, 10, 999], [-1, 0]],
|
\ 'winheight': [[1, 10, 999], [-1, 0]],
|
||||||
\ 'winminheight': [[0, 1], [-1]],
|
\ 'winminheight': [[0, 1], [-1]],
|
||||||
\ 'winminwidth': [[0, 1, 10], [-1]],
|
\ 'winminwidth': [[0, 1, 10], [-1]],
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
758,
|
||||||
/**/
|
/**/
|
||||||
757,
|
757,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user