comparison src/evalbuffer.c @ 21855:c8456ff7a4c3 v8.2.1477

patch 8.2.1477: Vim9: error when using bufnr('%') Commit: https://github.com/vim/vim/commit/f39397e515067d5a314be99778e63fe0acf93c51 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 17 22:21:36 2020 +0200 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 https://github.com/vim/vim/issues/6723)
author Bram Moolenaar <Bram@vim.org>
date Mon, 17 Aug 2020 22:30:04 +0200
parents d571231175b4
children c9517003821d
comparison
equal deleted inserted replaced
21854:f324c9bc756d 21855:c8456ff7a4c3
388 388
389 if (argvars[0].v_type == VAR_UNKNOWN) 389 if (argvars[0].v_type == VAR_UNKNOWN)
390 buf = curbuf; 390 buf = curbuf;
391 else 391 else
392 { 392 {
393 (void)tv_get_number(&argvars[0]); // issue errmsg if type error 393 if (argvars[0].v_type != VAR_STRING)
394 (void)tv_get_number(&argvars[0]); // issue errmsg if type error
394 ++emsg_off; 395 ++emsg_off;
395 buf = tv_get_buf(&argvars[0], FALSE); 396 buf = tv_get_buf(&argvars[0], FALSE);
396 --emsg_off; 397 --emsg_off;
397 } 398 }
398 399