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,6 +390,7 @@ f_bufnr(typval_T *argvars, typval_T *rettv)
|
|||||||
buf = curbuf;
|
buf = curbuf;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (argvars[0].v_type != VAR_STRING)
|
||||||
(void)tv_get_number(&argvars[0]); // issue errmsg if type error
|
(void)tv_get_number(&argvars[0]); // issue errmsg if type error
|
||||||
++emsg_off;
|
++emsg_off;
|
||||||
buf = tv_get_buf(&argvars[0], FALSE);
|
buf = tv_get_buf(&argvars[0], FALSE);
|
||||||
|
@ -1315,6 +1315,11 @@ def Test_filter_return_type()
|
|||||||
assert_equal(6, res)
|
assert_equal(6, res)
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_bufnr()
|
||||||
|
let buf = bufnr()
|
||||||
|
assert_equal(buf, bufnr('%'))
|
||||||
|
enddef
|
||||||
|
|
||||||
def Test_getreg_return_type()
|
def Test_getreg_return_type()
|
||||||
let s1: string = getreg('"')
|
let s1: string = getreg('"')
|
||||||
let s2: string = getreg('"', 1)
|
let s2: string = getreg('"', 1)
|
||||||
|
@ -754,6 +754,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1477,
|
||||||
/**/
|
/**/
|
||||||
1476,
|
1476,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user