mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0655: not easy to make sure a function does not exist
Problem: Not easy to make sure a function does not exist. Solution: Add ! as an optional argument to :delfunc.
This commit is contained in:
@@ -426,7 +426,7 @@ EX(CMD_delcommand, "delcommand", ex_delcommand,
|
|||||||
NEEDARG|WORD1|TRLBAR|CMDWIN,
|
NEEDARG|WORD1|TRLBAR|CMDWIN,
|
||||||
ADDR_LINES),
|
ADDR_LINES),
|
||||||
EX(CMD_delfunction, "delfunction", ex_delfunction,
|
EX(CMD_delfunction, "delfunction", ex_delfunction,
|
||||||
NEEDARG|WORD1|CMDWIN,
|
BANG|NEEDARG|WORD1|CMDWIN,
|
||||||
ADDR_LINES),
|
ADDR_LINES),
|
||||||
EX(CMD_display, "display", ex_display,
|
EX(CMD_display, "display", ex_display,
|
||||||
EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN,
|
EXTRA|NOTRLCOM|TRLBAR|SBOXOK|CMDWIN,
|
||||||
|
@@ -1390,6 +1390,16 @@ func Test_endfunction_trailing()
|
|||||||
set verbose=0
|
set verbose=0
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_delfunction_force()
|
||||||
|
delfunc! Xtest
|
||||||
|
delfunc! Xtest
|
||||||
|
func Xtest()
|
||||||
|
echo 'nothing'
|
||||||
|
endfunc
|
||||||
|
delfunc! Xtest
|
||||||
|
delfunc! Xtest
|
||||||
|
endfunc
|
||||||
|
|
||||||
"-------------------------------------------------------------------------------
|
"-------------------------------------------------------------------------------
|
||||||
" Modelines {{{1
|
" Modelines {{{1
|
||||||
" vim: ts=8 sw=4 tw=80 fdm=marker
|
" vim: ts=8 sw=4 tw=80 fdm=marker
|
||||||
|
@@ -2807,7 +2807,8 @@ ex_delfunction(exarg_T *eap)
|
|||||||
{
|
{
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
{
|
{
|
||||||
EMSG2(_(e_nofunc), eap->arg);
|
if (!eap->forceit)
|
||||||
|
EMSG2(_(e_nofunc), eap->arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fp->uf_calls > 0)
|
if (fp->uf_calls > 0)
|
||||||
|
@@ -764,6 +764,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
655,
|
||||||
/**/
|
/**/
|
||||||
654,
|
654,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user