diff options
-rw-r--r-- | src/evalbuffer.c | 3 | ||||
-rw-r--r-- | src/testdir/test_vim9_func.vim | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c index df5270a953..2d738f1249 100644 --- a/src/evalbuffer.c +++ b/src/evalbuffer.c @@ -390,7 +390,8 @@ f_bufnr(typval_T *argvars, typval_T *rettv) buf = curbuf; else { - (void)tv_get_number(&argvars[0]); // issue errmsg if type error + if (argvars[0].v_type != VAR_STRING) + (void)tv_get_number(&argvars[0]); // issue errmsg if type error ++emsg_off; buf = tv_get_buf(&argvars[0], FALSE); --emsg_off; diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim index 38d613ae0b..446ee4d03d 100644 --- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -1315,6 +1315,11 @@ def Test_filter_return_type() assert_equal(6, res) enddef +def Test_bufnr() + let buf = bufnr() + assert_equal(buf, bufnr('%')) +enddef + def Test_getreg_return_type() let s1: string = getreg('"') let s2: string = getreg('"', 1) diff --git a/src/version.c b/src/version.c index 734d2ba2ff..e332c011ed 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 */ /**/ + 1477, +/**/ 1476, /**/ 1475, |