fileio: Replace some event checking functions with one has_event

This commit is contained in:
Charles Joachim
2016-01-10 22:45:49 -05:00
parent 3b94756feb
commit 879c668d14
4 changed files with 47 additions and 92 deletions

View File

@@ -6266,50 +6266,12 @@ int trigger_cursorhold(void)
return FALSE;
}
/*
* Return TRUE when there is a CursorMoved autocommand defined.
*/
int has_cursormoved(void)
/// Return true if "event" autocommand is defined.
///
/// @param event the autocommand to check
bool has_event(int event) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
{
return first_autopat[(int)EVENT_CURSORMOVED] != NULL;
}
/*
* Return TRUE when there is a CursorMovedI autocommand defined.
*/
int has_cursormovedI(void)
{
return first_autopat[(int)EVENT_CURSORMOVEDI] != NULL;
}
/*
* Return TRUE when there is a TextChanged autocommand defined.
*/
int has_textchanged(void)
{
return first_autopat[(int)EVENT_TEXTCHANGED] != NULL;
}
/*
* Return TRUE when there is a TextChangedI autocommand defined.
*/
int has_textchangedI(void)
{
return first_autopat[(int)EVENT_TEXTCHANGEDI] != NULL;
}
/*
* Return TRUE when there is an InsertCharPre autocommand defined.
*/
int has_insertcharpre(void)
{
return first_autopat[(int)EVENT_INSERTCHARPRE] != NULL;
}
/// @returns true when there is an CmdUndefined autocommand defined.
int has_cmdundefined(void)
{
return first_autopat[(int)EVENT_CMDUNDEFINED] != NULL;
return first_autopat[event] != NULL;
}
static int