summaryrefslogtreecommitdiffstats
path: root/src/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/message.c b/src/message.c
index 7a6e346096..935fd8c447 100644
--- a/src/message.c
+++ b/src/message.c
@@ -847,6 +847,17 @@ emsg_invreg(int name)
}
/*
+ * Give an error message which contains %s for "name[len]".
+ */
+ void
+emsg_namelen(char *msg, char_u *name, int len)
+{
+ char_u *copy = vim_strnsave((char_u *)name, len);
+
+ semsg(msg, copy == NULL ? "NULL" : (char *)copy);
+}
+
+/*
* Like msg(), but truncate to a single line if p_shm contains 't', or when
* "force" is TRUE. This truncates in another way as for normal messages.
* Careful: The string may be changed by msg_may_trunc()!