diff src/fileio.c @ 609:ba54311bc43e

updated for version 7.0173
author vimboss
date Sun, 18 Dec 2005 22:02:33 +0000
parents fea48f63efc8
children b9370cfb091a
line wrap: on
line diff
--- 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, fnam
 }
 
 #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