diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-01 12:22:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-01 12:22:46 +0100 |
commit | d83392a43a48c566c0f3b76382a3648584dae32b (patch) | |
tree | ba5c2d376a386d524190fd0f7565c3af1b624701 /src/insexpand.c | |
parent | e42c8dae32f3575557b83a371c4be66c09afbf7f (diff) | |
download | vim-git-d83392a43a48c566c0f3b76382a3648584dae32b.tar.gz |
patch 9.0.0345: error message for list argument could be clearerv9.0.0345
Problem: Error message for list argument could be clearer.
Solution: Include the argument number. (Yegappan Lakshmanan, closes #11027)
Diffstat (limited to 'src/insexpand.c')
-rw-r--r-- | src/insexpand.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/insexpand.c b/src/insexpand.c index 1ff1c99b7..b91c23001 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -2930,9 +2930,7 @@ f_complete(typval_T *argvars, typval_T *rettv UNUSED) if (!undo_allowed()) return; - if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL) - emsg(_(e_invalid_argument)); - else + if (check_for_nonnull_list_arg(argvars, 1) != FAIL) { startcol = (int)tv_get_number_chk(&argvars[0], NULL); if (startcol > 0) @@ -3143,11 +3141,8 @@ f_complete_info(typval_T *argvars, typval_T *rettv) if (argvars[0].v_type != VAR_UNKNOWN) { - if (argvars[0].v_type != VAR_LIST) - { - emsg(_(e_list_required)); + if (check_for_list_arg(argvars, 0) == FAIL) return; - } what_list = argvars[0].vval.v_list; } get_complete_info(what_list, rettv->vval.v_dict); |