forked from aniani/vim
patch 8.2.1477: Vim9: error when using bufnr('%')
Problem: Vim9: error when using bufnr('%'). Solution: Don't give an error for using a string argument. (closes #6723)
This commit is contained in:
parent
aa9675a61d
commit
f39397e515
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1477,
|
||||
/**/
|
||||
1476,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user