Problem: Not easy to make sure a function does not exist.
Solution: Add ! as an optional argument to :delfunc.
NEEDARG|WORD1|TRLBAR|CMDWIN,
ADDR_LINES),
EX(CMD_delfunction, "delfunction", ex_delfunction,
- NEEDARG|WORD1|CMDWIN,
+ BANG|NEEDARG|WORD1|CMDWIN,
ADDR_LINES),
EX(CMD_display, "display", ex_display,
EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN,
set verbose=0
endfunc
+func Test_delfunction_force()
+ delfunc! Xtest
+ delfunc! Xtest
+ func Xtest()
+ echo 'nothing'
+ endfunc
+ delfunc! Xtest
+ delfunc! Xtest
+endfunc
+
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=4 tw=80 fdm=marker
{
if (fp == NULL)
{
- EMSG2(_(e_nofunc), eap->arg);
+ if (!eap->forceit)
+ EMSG2(_(e_nofunc), eap->arg);
return;
}
if (fp->uf_calls > 0)
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 655,
/**/
654,
/**/