mirror of
https://github.com/neovim/neovim.git
synced 2025-09-10 21:38:19 +00:00
feat(eval/method): partially port v8.1.1925
Adds method call support for all functions in the patch, but it cannot be fully ported due to missing tests for: - getcwd(): requires chdir() and Test_chdir_func() from v8.1.1291. Note that the method call tests for getreg() and getregtype() were removed in v8.2.1547, which has already been ported, but doesn't seem to have been replaced with a new test... This patch also makes getchangelist()'s argument optional (defaults to the current buffer). eval.txt includes a typo for gettabwinvar(), which is fixed in v8.1.1952.
This commit is contained in:
@@ -3088,10 +3088,16 @@ f_getbufvar_end:
|
||||
static void f_getchangelist(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
{
|
||||
tv_list_alloc_ret(rettv, 2);
|
||||
vim_ignored = tv_get_number(&argvars[0]); // issue errmsg if type error
|
||||
emsg_off++;
|
||||
const buf_T *const buf = tv_get_buf(&argvars[0], false);
|
||||
emsg_off--;
|
||||
|
||||
const buf_T *buf;
|
||||
if (argvars[0].v_type == VAR_UNKNOWN) {
|
||||
buf = curbuf;
|
||||
} else {
|
||||
vim_ignored = tv_get_number(&argvars[0]); // issue errmsg if type error
|
||||
emsg_off++;
|
||||
buf = tv_get_buf(&argvars[0], false);
|
||||
emsg_off--;
|
||||
}
|
||||
if (buf == NULL) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user