Bram,
this patch adds the possibility to query for the existence of sign ids
using exists().
Current idea is to use exists('#number') to check for the numeric id
(and thus it can't be an autocommand).
regards,
Christian
--
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r 622623485389 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Sat Jan 26 15:39:20 2013 +0100
+++ b/runtime/doc/eval.txt Sat Jan 26 16:20:34 2013 +0100
@@ -2698,6 +2698,8 @@
always check the return value to be 2.
:2match The |:2match| command.
:3match The |:3match| command.
+ #number Sign with this numeric id exists in
+ the current buffer
#event autocommand defined for this event
#event#pattern autocommand defined for this event and
pattern (the pattern is taken
diff -r 622623485389 src/eval.c
--- a/src/eval.c Sat Jan 26 15:39:20 2013 +0100
+++ b/src/eval.c Sat Jan 26 16:20:34 2013 +0100
@@ -10021,7 +10021,24 @@
if (p[1] == '#')
n = autocmd_supported(p + 2);
else
- n = au_exists(p + 1);
+ {
+#ifdef FEAT_SIGNS
+ if (VIM_ISDIGIT(*(p+1)))
+ {
+ int id = 0;
+ signlist_T *sign;
+
+ p++;
+ id = getdigits(&p);
+
+ for (sign = curbuf->b_signlist; sign != NULL && !n; sign = sign->next)
+ if (sign->id == id)
+ n = TRUE;
+ }
+ else
+#endif
+ n = au_exists(p + 1);
+ }
#endif
}
else /* internal variable */