summaryrefslogtreecommitdiffstats
path: root/src/typval.c
diff options
context:
space:
mode:
authorErnie Rael <errael@raelity.com>2022-05-04 15:40:22 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-04 15:40:22 +0100
commit51d04d16f21e19d6eded98f9530d84089102f925 (patch)
tree20bb53da9296e31af0101070f69c689724c04f61 /src/typval.c
parent05cf63e9bdca1ac070df3e7d9c6dfc45e68ac916 (diff)
patch 8.2.4861: it is not easy to restore saved mappingsv8.2.4861
Problem: It is not easy to restore saved mappings. Solution: Make mapset() accept a dict argument. (Ernie Rael, closes #10295)
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/typval.c b/src/typval.c
index 4f6e41dfdd..b131ba2c15 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -360,6 +360,20 @@ tv_get_float(typval_T *varp)
#endif
/*
+ * Give an error and return FAIL unless "args[idx]" is unknown
+ */
+ int
+check_for_unknown_arg(typval_T *args, int idx)
+{
+ if (args[idx].v_type != VAR_UNKNOWN)
+ {
+ semsg(_(e_too_many_arguments), idx + 1);
+ return FAIL;
+ }
+ return OK;
+}
+
+/*
* Give an error and return FAIL unless "args[idx]" is a string.
*/
int