summaryrefslogtreecommitdiff
path: root/src/fileio.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-12-18 22:02:33 +0000
committerBram Moolenaar <Bram@vim.org>2005-12-18 22:02:33 +0000
commitd35f9711d4558f8784e65531a152d38d1dabbe72 (patch)
treeb87fb3537c2ac512ca97a6e342c1cb9762e40892 /src/fileio.c
parentda1b1a735765071185281ce86a379ea0d078cb17 (diff)
downloadvim-d35f9711d4558f8784e65531a152d38d1dabbe72.zip
updated for version 7.0173
Diffstat (limited to 'src/fileio.c')
-rw-r--r--src/fileio.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 0cfbc2222..5b083f950 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -7483,6 +7483,8 @@ au_event_restore(old_ei)
* :autocmd bufleave * set tw=79 nosmartindent ic infercase
*
* :autocmd * *.c show all autocommands for *.c files.
+ *
+ * Mostly a {group} argument can optionally appear before <event>.
*/
void
do_autocmd(arg, forceit)
@@ -8168,11 +8170,26 @@ apply_autocmds_retval(event, fname, fname_io, force, buf, retval)
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
+/*
+ * Return TRUE when there is a CursorHold autocommand defined.
+ */
int
has_cursorhold()
{
return (first_autopat[(int)EVENT_CURSORHOLD] != NULL);
}
+
+/*
+ * Return TRUE if the CursorHold event can be triggered.
+ */
+ int
+trigger_cursorhold()
+{
+ return (!did_cursorhold
+ && has_cursorhold()
+ && !Recording
+ && get_real_state() == NORMAL_BUSY);
+}
#endif
static int