summaryrefslogtreecommitdiff
path: root/src/popupwin.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-08-30 19:48:24 +0100
committerBram Moolenaar <Bram@vim.org>2022-08-30 19:48:24 +0100
commit04c4c5746e15884768d2cb41370c3276a196cd4c (patch)
tree1e629820796635bd332b2066c03d548fad527f89 /src/popupwin.c
parentf240395fca63d4b330112a4b81e94b05b50de1aa (diff)
downloadvim-git-04c4c5746e15884768d2cb41370c3276a196cd4c.tar.gz
patch 9.0.0335: checks for Dictionary argument often give a vague errorv9.0.0335
Problem: Checks for Dictionary argument often give a vague error message. Solution: Give a useful error message. (Yegappan Lakshmanan, closes #11009)
Diffstat (limited to 'src/popupwin.c')
-rw-r--r--src/popupwin.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/popupwin.c b/src/popupwin.c
index 7459b98d4..2f9df8d9e 100644
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -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;