summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
authorBakudankun <bakudankun@gmail.com>2022-09-09 18:46:47 +0100
committerBram Moolenaar <Bram@vim.org>2022-09-09 18:46:47 +0100
commit375141e1f80dced9be738568a3418f65813f4a2f (patch)
treebe23086bf0c21bbf564b42298909d856ac6780cf /src/typval.c
parent0adae2da17598669e442ba38547ab18a6c1406de (diff)
downloadvim-git-375141e1f80dced9be738568a3418f65813f4a2f.tar.gz
patch 9.0.0430: cannot use repeat() with a blobv9.0.0430
Problem: Cannot use repeat() with a blob. Solution: Implement blob repeat. (closes #11090)
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c
index 12a741ec2..95abe212e 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -792,6 +792,24 @@ check_for_opt_string_or_number_or_list_arg(typval_T *args, int idx)
}
/*
+ * 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.
*/