0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1590: Vim9: bufnr() doesn't take "true" argument

Problem:    Vim9: bufnr() doesn't take "true" argument.
Solution:   use tv_get_bool_chk(). (closes #6863)
This commit is contained in:
Bram Moolenaar
2020-09-04 18:35:26 +02:00
parent b936b79424
commit fe136c9a85
3 changed files with 7 additions and 1 deletions

View File

@@ -391,7 +391,7 @@ f_bufnr(typval_T *argvars, typval_T *rettv)
// new buffer.
if (buf == NULL
&& argvars[1].v_type != VAR_UNKNOWN
&& tv_get_number_chk(&argvars[1], &error) != 0
&& tv_get_bool_chk(&argvars[1], &error) != 0
&& !error
&& (name = tv_get_string_chk(&argvars[0])) != NULL
&& !error)

View File

@@ -1327,6 +1327,10 @@ enddef
def Test_bufnr()
let buf = bufnr()
assert_equal(buf, bufnr('%'))
buf = bufnr('Xdummy', true)
assert_notequal(-1, buf)
exe 'bwipe! ' .. buf
enddef
def Test_col()

View File

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