aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-01-12 09:45:09 -0500
committerJustin M. Keyes <justinkz@gmail.com>2016-01-12 09:45:09 -0500
commit970b5f2752feb3ba5c906c5019f5ea778ead5a90 (patch)
tree8cdcd8f7d2a04e2b30773018a7b51d14ee18b998 /src/nvim/fileio.c
parent7497dbee16fa8a452d12a9134e58526c255813bc (diff)
parent879c668d14095b5eaa5204c89034e369a8f0240d (diff)
downloadrneovim-970b5f2752feb3ba5c906c5019f5ea778ead5a90.tar.gz
rneovim-970b5f2752feb3ba5c906c5019f5ea778ead5a90.tar.bz2
rneovim-970b5f2752feb3ba5c906c5019f5ea778ead5a90.zip
Merge pull request #3984 from cacplate/has_event
Remove redundant functions to replace for the general has_event function
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c48
1 files changed, 5 insertions, 43 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 05cb8f8f8c..bd0f0fc80a 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -6266,50 +6266,12 @@ int trigger_cursorhold(void)
return FALSE;
}
-/*
- * Return TRUE when there is a CursorMoved autocommand defined.
- */
-int has_cursormoved(void)
-{
- 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 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_CMDUNDEFINED] != NULL;
+ return first_autopat[event] != NULL;
}
static int