diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-28 16:39:33 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-28 16:39:33 +0200 |
commit | 6a950581da52b410a74531044aae8f1f8f38a7df (patch) | |
tree | 7f25c7868544d30a3b749d78911e923471f6a728 | |
parent | 2566054a7f406a6c9a082e7fd5f1597164668ca9 (diff) | |
download | vim-git-6a950581da52b410a74531044aae8f1f8f38a7df.tar.gz |
patch 8.2.1533: Vim9: error when passing getreginfo() result to setreg()v8.2.1533
Problem: Vim9: error when passing getreginfo() result to setreg().
Solution: Use dict_get_bool() for "isunnamed". (closes #6784)
-rw-r--r-- | src/evalfunc.c | 2 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 7 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index fcfd4b10d..270dcd2cd 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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 diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 412e4a6dc..2c23a0e16 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -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 diff --git a/src/version.c b/src/version.c index ba62765bc..e6299f413 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1533, +/**/ 1532, /**/ 1531, |