aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorCharles Joachim <cacplate@gmail.com>2016-01-10 22:45:49 -0500
committerCharles Joachim <cacplate@gmail.com>2016-01-11 08:45:19 -0500
commit879c668d14095b5eaa5204c89034e369a8f0240d (patch)
tree328089e9d464de887210b8b2f3973637a98073e5 /src/nvim/fileio.c
parent3b94756feb39ad269104b2f765c6c56ff2360203 (diff)
downloadrneovim-879c668d14095b5eaa5204c89034e369a8f0240d.tar.gz
rneovim-879c668d14095b5eaa5204c89034e369a8f0240d.tar.bz2
rneovim-879c668d14095b5eaa5204c89034e369a8f0240d.zip
fileio: Replace some event checking functions with one has_event
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