patch 8.2.1533: Vim9: error when passing getreginfo() result to setreg()

Problem:    Vim9: error when passing getreginfo() result to setreg().
Solution:   Use dict_get_bool() for "isunnamed". (closes #6784)
This commit is contained in:
Bram Moolenaar
2020-08-28 16:39:33 +02:00
parent 2566054a7f
commit 6a950581da
3 changed files with 10 additions and 1 deletions

View File

@ -7427,7 +7427,7 @@ f_setreg(typval_T *argvars, typval_T *rettv)
regname = pointreg;
}
}
else if (dict_get_number(d, (char_u *)"isunnamed"))
else if (dict_get_bool(d, (char_u *)"isunnamed", -1) > 0)
pointreg = regname;
}
else

View File

@ -1419,6 +1419,13 @@ def Test_setbufvar()
setlocal ts=8
enddef
def Test_setreg()
setreg('a', ['aaa', 'bbb', 'ccc'])
let reginfo = getreginfo('a')
setreg('a', reginfo)
assert_equal(reginfo, getreginfo('a'))
enddef
def Fibonacci(n: number): number
if n < 2
return n

View File

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