mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38:32 +00:00
vim-patch:9.1.0900: Vim9: digraph_getlist() does not accept bool arg (#31431)
Problem: Vim9: digraph_getlist() does not accept bool argument
(Maxim Kim)
Solution: accept boolean as first argument (Yegappan Lakshmanan)
fixes: vim/vim#16154
closes: vim/vim#16159
198ada3d9f
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -1954,16 +1954,16 @@ void f_digraph_get(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
|||||||
/// "digraph_getlist()" function
|
/// "digraph_getlist()" function
|
||||||
void f_digraph_getlist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
void f_digraph_getlist(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||||
{
|
{
|
||||||
|
if (tv_check_for_opt_bool_arg(argvars, 0) == FAIL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool flag_list_all;
|
bool flag_list_all;
|
||||||
|
|
||||||
if (argvars[0].v_type == VAR_UNKNOWN) {
|
if (argvars[0].v_type == VAR_UNKNOWN) {
|
||||||
flag_list_all = false;
|
flag_list_all = false;
|
||||||
} else {
|
} else {
|
||||||
bool error = false;
|
varnumber_T flag = tv_get_bool(&argvars[0]);
|
||||||
varnumber_T flag = tv_get_number_chk(&argvars[0], &error);
|
|
||||||
if (error) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
flag_list_all = flag != 0;
|
flag_list_all = flag != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -607,8 +607,10 @@ func Test_digraph_getlist_function()
|
|||||||
" of digraphs returned.
|
" of digraphs returned.
|
||||||
call assert_equal(digraph_getlist()->len(), digraph_getlist(0)->len())
|
call assert_equal(digraph_getlist()->len(), digraph_getlist(0)->len())
|
||||||
call assert_notequal(digraph_getlist()->len(), digraph_getlist(1)->len())
|
call assert_notequal(digraph_getlist()->len(), digraph_getlist(1)->len())
|
||||||
|
call assert_equal(digraph_getlist()->len(), digraph_getlist(v:false)->len())
|
||||||
|
call assert_notequal(digraph_getlist()->len(), digraph_getlist(v:true)->len())
|
||||||
|
|
||||||
call assert_fails('call digraph_getlist(0z12)', 'E974: Using a Blob as a Number')
|
call assert_fails('call digraph_getlist(0z12)', 'E1212: Bool required for argument 1')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user