mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 14:56:08 +00:00
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)
04c4c5746e
Cherry-pick removal of E922 from docs from patch 9.0.1403.
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -2772,8 +2772,7 @@ void f_searchcount(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
dictitem_T *di;
|
||||
bool error = false;
|
||||
|
||||
if (argvars[0].v_type != VAR_DICT || argvars[0].vval.v_dict == NULL) {
|
||||
emsg(_(e_dictreq));
|
||||
if (tv_check_for_nonnull_dict_arg(argvars, 0) == FAIL) {
|
||||
return;
|
||||
}
|
||||
dict = argvars[0].vval.v_dict;
|
||||
@@ -3348,8 +3347,7 @@ static void do_fuzzymatch(const typval_T *const argvars, typval_T *const rettv,
|
||||
bool matchseq = false;
|
||||
long max_matches = 0;
|
||||
if (argvars[2].v_type != VAR_UNKNOWN) {
|
||||
if (argvars[2].v_type != VAR_DICT || argvars[2].vval.v_dict == NULL) {
|
||||
emsg(_(e_dictreq));
|
||||
if (tv_check_for_nonnull_dict_arg(argvars, 2) == FAIL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user