1
0
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:
Bakudankun
2022-09-09 18:46:47 +01:00
committed by Bram Moolenaar
parent 0adae2da17
commit 375141e1f8
9 changed files with 87 additions and 8 deletions

View File

@@ -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.