diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-17 22:21:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-17 22:21:36 +0200 |
commit | f39397e515067d5a314be99778e63fe0acf93c51 (patch) | |
tree | 6b1b6a67934b2e12ceb58784e7c33a80a1db5ac1 /src/evalbuffer.c | |
parent | aa9675a61d510c4a56c3845d05b32b1ef780d119 (diff) | |
download | vim-git-f39397e515067d5a314be99778e63fe0acf93c51.tar.gz |
patch 8.2.1477: Vim9: error when using bufnr('%')v8.2.1477
Problem: Vim9: error when using bufnr('%').
Solution: Don't give an error for using a string argument. (closes #6723)
Diffstat (limited to 'src/evalbuffer.c')
-rw-r--r-- | src/evalbuffer.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evalbuffer.c b/src/evalbuffer.c index df5270a95..2d738f124 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; |