Mercurial > vim
comparison src/insexpand.c @ 30015:adb0de8be4ce v9.0.0345
patch 9.0.0345: error message for list argument could be clearer
Commit: https://github.com/vim/vim/commit/d83392a43a48c566c0f3b76382a3648584dae32b
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 1 12:22:46 2022 +0100
patch 9.0.0345: error message for list argument could be clearer
Problem: Error message for list argument could be clearer.
Solution: Include the argument number. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/11027)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 01 Sep 2022 13:30:05 +0200 |
parents | b5bd6521f417 |
children | d45ee1f829ba |
comparison
equal
deleted
inserted
replaced
30014:3fb163e2ef6c | 30015:adb0de8be4ce |
---|---|
2928 // Check for undo allowed here, because if something was already inserted | 2928 // Check for undo allowed here, because if something was already inserted |
2929 // the line was already saved for undo and this check isn't done. | 2929 // the line was already saved for undo and this check isn't done. |
2930 if (!undo_allowed()) | 2930 if (!undo_allowed()) |
2931 return; | 2931 return; |
2932 | 2932 |
2933 if (argvars[1].v_type != VAR_LIST || argvars[1].vval.v_list == NULL) | 2933 if (check_for_nonnull_list_arg(argvars, 1) != FAIL) |
2934 emsg(_(e_invalid_argument)); | |
2935 else | |
2936 { | 2934 { |
2937 startcol = (int)tv_get_number_chk(&argvars[0], NULL); | 2935 startcol = (int)tv_get_number_chk(&argvars[0], NULL); |
2938 if (startcol > 0) | 2936 if (startcol > 0) |
2939 set_completion(startcol - 1, argvars[1].vval.v_list); | 2937 set_completion(startcol - 1, argvars[1].vval.v_list); |
2940 } | 2938 } |
3141 if (in_vim9script() && check_for_opt_list_arg(argvars, 0) == FAIL) | 3139 if (in_vim9script() && check_for_opt_list_arg(argvars, 0) == FAIL) |
3142 return; | 3140 return; |
3143 | 3141 |
3144 if (argvars[0].v_type != VAR_UNKNOWN) | 3142 if (argvars[0].v_type != VAR_UNKNOWN) |
3145 { | 3143 { |
3146 if (argvars[0].v_type != VAR_LIST) | 3144 if (check_for_list_arg(argvars, 0) == FAIL) |
3147 { | |
3148 emsg(_(e_list_required)); | |
3149 return; | 3145 return; |
3150 } | |
3151 what_list = argvars[0].vval.v_list; | 3146 what_list = argvars[0].vval.v_list; |
3152 } | 3147 } |
3153 get_complete_info(what_list, rettv->vval.v_dict); | 3148 get_complete_info(what_list, rettv->vval.v_dict); |
3154 } | 3149 } |
3155 #endif | 3150 #endif |