diff options
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 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; |