From 43c49746d9cf82dba0d56b07d39722f9ebeecf90 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 25 Apr 2023 21:32:12 +0800 Subject: vim-patch:9.0.0335: checks for Dictionary argument often give a vague error (#23309) Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes vim/vim#11009) https://github.com/vim/vim/commit/04c4c5746e15884768d2cb41370c3276a196cd4c Cherry-pick removal of E922 from docs from patch 9.0.1403. Co-authored-by: Yegappan Lakshmanan --- src/nvim/mapping.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/mapping.c') diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c index c1565a84f5..f88c0deb87 100644 --- a/src/nvim/mapping.c +++ b/src/nvim/mapping.c @@ -2204,8 +2204,7 @@ void f_mapset(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) const int mode = get_map_mode((char **)&which, 0); const bool is_abbr = tv_get_number(&argvars[1]) != 0; - if (argvars[2].v_type != VAR_DICT) { - emsg(_(e_dictreq)); + if (tv_check_for_dict_arg(argvars, 2) == FAIL) { return; } dict_T *d = argvars[2].vval.v_dict; -- cgit