mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
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 #11027)
This commit is contained in:
17
src/typval.c
17
src/typval.c
@@ -508,6 +508,23 @@ check_for_list_arg(typval_T *args, int idx)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Give an error and return FAIL unless "args[idx]" is a non-NULL list.
|
||||
*/
|
||||
int
|
||||
check_for_nonnull_list_arg(typval_T *args, int idx)
|
||||
{
|
||||
if (check_for_list_arg(args, idx) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
if (args[idx].vval.v_list == NULL)
|
||||
{
|
||||
semsg(_(e_non_null_list_required_for_argument_nr), idx + 1);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for an optional list argument at 'idx'
|
||||
*/
|
||||
|
Reference in New Issue
Block a user