forked from aniani/vim
patch 9.0.0430: cannot use repeat() with a blob
Problem: Cannot use repeat() with a blob. Solution: Implement blob repeat. (closes #11090)
This commit is contained in:
committed by
Bram Moolenaar
parent
0adae2da17
commit
375141e1f8
18
src/typval.c
18
src/typval.c
@@ -791,6 +791,24 @@ check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx)
|
||||
|| check_for_string_or_number_or_list_arg(args, idx) != FAIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Give an error and return FAIL unless "args[idx]" is a string or a number
|
||||
* or a list or a blob.
|
||||
*/
|
||||
int
|
||||
check_for_string_or_number_or_list_or_blob_arg(typval_T *args, int idx)
|
||||
{
|
||||
if (args[idx].v_type != VAR_STRING
|
||||
&& args[idx].v_type != VAR_NUMBER
|
||||
&& args[idx].v_type != VAR_LIST
|
||||
&& args[idx].v_type != VAR_BLOB)
|
||||
{
|
||||
semsg(_(e_string_number_list_or_blob_required_for_argument_nr), idx + 1);
|
||||
return FAIL;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Give an error and return FAIL unless "args[idx]" is a string or a list
|
||||
* or a dict.
|
||||
|
Reference in New Issue
Block a user