mirror of
https://github.com/vim/vim.git
synced 2025-08-26 20:03:41 -04:00
patch 8.2.1606: Vim9: cannot use "true" with has()
Problem: Vim9: cannot use "true" with has(). Solution: Use tv_get_bool(). (closes #6876)
This commit is contained in:
parent
b02628b8a2
commit
04637e243d
@ -4763,7 +4763,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argvars[1].v_type != VAR_UNKNOWN && tv_get_number(&argvars[1]) != 0)
|
if (argvars[1].v_type != VAR_UNKNOWN && tv_get_bool(&argvars[1]))
|
||||||
// return whether feature could ever be enabled
|
// return whether feature could ever be enabled
|
||||||
rettv->vval.v_number = x;
|
rettv->vval.v_number = x;
|
||||||
else
|
else
|
||||||
|
@ -1516,6 +1516,10 @@ def Test_getcompletion()
|
|||||||
set wildignore&
|
set wildignore&
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_has()
|
||||||
|
assert_equal(1, has('eval', true))
|
||||||
|
enddef
|
||||||
|
|
||||||
def Fibonacci(n: number): number
|
def Fibonacci(n: number): number
|
||||||
if n < 2
|
if n < 2
|
||||||
return n
|
return n
|
||||||
|
@ -754,6 +754,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 */
|
||||||
|
/**/
|
||||||
|
1606,
|
||||||
/**/
|
/**/
|
||||||
1605,
|
1605,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user