0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.2.1573: Vim9: getreg() does not take "true" as argument

Problem:    Vim9: getreg() does not take "true" as argument.
Solution:   Use tv_get_bool_chk().  (closes #6820)
This commit is contained in:
Bram Moolenaar 2020-09-02 21:45:54 +02:00
parent 551d25e765
commit 67ff97ded7
3 changed files with 10 additions and 2 deletions

View File

@ -3336,9 +3336,9 @@ f_getreg(typval_T *argvars, typval_T *rettv)
error = strregname == NULL;
if (argvars[1].v_type != VAR_UNKNOWN)
{
arg2 = (int)tv_get_number_chk(&argvars[1], &error);
arg2 = (int)tv_get_bool_chk(&argvars[1], &error);
if (!error && argvars[2].v_type != VAR_UNKNOWN)
return_list = (int)tv_get_number_chk(&argvars[2], &error);
return_list = (int)tv_get_bool_chk(&argvars[2], &error);
}
}
else

View File

@ -1503,6 +1503,12 @@ def Test_expand()
close
enddef
def Test_getreg()
let lines = ['aaa', 'bbb', 'ccc']
setreg('a', lines)
assert_equal(lines, getreg('a', true, true))
enddef
def Test_recursive_call()
assert_equal(6765, Fibonacci(20))
enddef

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1573,
/**/
1572,
/**/