0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

updated for version 7.4.414

Problem:    Cannot define a command only when it's used.
Solution:   Add the CmdUndefined autocommand event. (partly by Yasuhiro
            Matsumoto)
This commit is contained in:
Bram Moolenaar
2014-08-22 23:05:54 +02:00
parent fb539273c9
commit d5005164e1
5 changed files with 56 additions and 0 deletions

View File

@@ -7641,6 +7641,7 @@ static struct event_name
{"BufWriteCmd", EVENT_BUFWRITECMD},
{"CmdwinEnter", EVENT_CMDWINENTER},
{"CmdwinLeave", EVENT_CMDWINLEAVE},
{"CmdUndefined", EVENT_CMDUNDEFINED},
{"ColorScheme", EVENT_COLORSCHEME},
{"CompleteDone", EVENT_COMPLETEDONE},
{"CursorHold", EVENT_CURSORHOLD},
@@ -9159,6 +9160,24 @@ has_insertcharpre()
return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
}
/*
* Return TRUE when there is an CmdUndefined autocommand defined.
*/
int
has_cmdundefined()
{
return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL);
}
/*
* Return TRUE when there is an FuncUndefined autocommand defined.
*/
int
has_funcundefined()
{
return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
}
static int
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
event_T event;