1
0
forked from aniani/vim

patch 9.0.0335: checks for Dictionary argument often give a vague error

Problem:    Checks for Dictionary argument often give a vague error message.
Solution:   Give a useful error message. (Yegappan Lakshmanan, closes #11009)
This commit is contained in:
Yegappan Lakshmanan
2022-08-30 19:48:24 +01:00
committed by Bram Moolenaar
parent f240395fca
commit 04c4c5746e
32 changed files with 128 additions and 183 deletions

View File

@@ -2016,11 +2016,8 @@ popup_create(typval_T *argvars, typval_T *rettv, create_type_T type)
emsg(_(e_buffer_number_text_or_list_required));
return NULL;
}
if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
{
emsg(_(e_dictionary_required));
if (check_for_nonnull_dict_arg(argvars, 1) == FAIL)
return NULL;
}
d = argvars[1].vval.v_dict;
}
@@ -2928,11 +2925,8 @@ f_popup_move(typval_T *argvars, typval_T *rettv UNUSED)
if (wp == NULL)
return; // invalid {id}
if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
{
emsg(_(e_dictionary_required));
if (check_for_nonnull_dict_arg(argvars, 1) == FAIL)
return;
}
dict = argvars[1].vval.v_dict;
apply_move_options(wp, dict);
@@ -2963,11 +2957,8 @@ f_popup_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
if (wp == NULL)
return; // invalid {id}
if (argvars[1].v_type != VAR_DICT || argvars[1].vval.v_dict == NULL)
{
emsg(_(e_dictionary_required));
if (check_for_nonnull_dict_arg(argvars, 1) == FAIL)
return;
}
dict = argvars[1].vval.v_dict;
old_firstline = wp->w_firstline;