summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-12-21 15:17:36 +0100
committerBram Moolenaar <Bram@vim.org>2018-12-21 15:17:36 +0100
commit162b71479bd4dcdb3a2ef9198a1444f6f99e6843 (patch)
treeedd67e40cafeff24ad1631f9035ecc132e73b22b /src/misc2.c
parent48f377a476e4a3312aa0e3535aba170484b59483 (diff)
downloadvim-git-162b71479bd4dcdb3a2ef9198a1444f6f99e6843.tar.gz
patch 8.1.0614: placing signs can be complicatedv8.1.0614
Problem: Placing signs can be complicated. Solution: Add functions for defining and placing signs. Introduce a group name to avoid different plugins using the same signs. (Yegappan Lakshmanan, closes #3652)
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 060a333ca..a0781d440 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -895,6 +895,19 @@ alloc_clear(unsigned size)
}
/*
+ * Same as alloc_clear() but with allocation id for testing
+ */
+ char_u *
+alloc_clear_id(unsigned size, alloc_id_T id UNUSED)
+{
+#ifdef FEAT_EVAL
+ if (alloc_fail_id == id && alloc_does_fail((long_u)size))
+ return NULL;
+#endif
+ return alloc_clear(size);
+}
+
+/*
* alloc() with check for maximum line length
*/
char_u *