changeset 609:ba54311bc43e

updated for version 7.0173
author vimboss
date Sun, 18 Dec 2005 22:02:33 +0000
parents def07088c90e
children cd3689efd90a
files runtime/doc/insert.txt src/fileio.c src/gui.c src/os_unix.c src/os_win32.c
diffstat 5 files changed, 25 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -1,4 +1,4 @@
-*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Dec 14
+*insert.txt*    For Vim version 7.0aa.  Last change: 2005 Dec 18
 
 
 		  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -965,6 +965,8 @@ While the menu is displayed these keys h
 <CR> and <Enter>: Accept the currently selected match
 <Up>:             Select the previous match, as if CTRL-P was used
 <Down>:           Select the next match, as if CTRL-N was used
+<PageUp>:	  Select a match several entries back
+<PageDown>:	  Select a match several entries further
 
 The colors of the menu can be changed with these highlight groups:
 Pmenu		normal item  |hl-Pmenu|
--- 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
--- a/src/gui.c
+++ b/src/gui.c
@@ -2653,8 +2653,7 @@ gui_wait_for_chars(wtime)
     if (gui_mch_wait_for_chars(p_ut) == OK)
 	retval = OK;
 #ifdef FEAT_AUTOCMD
-    else if (!did_cursorhold && has_cursorhold()
-					   && get_real_state() == NORMAL_BUSY)
+    else if (trigger_cursorhold())
     {
 	char_u	buf[3];
 
@@ -4639,7 +4638,7 @@ gui_do_findrepl(flags, find_text, repl_t
 			u_sync();
 
 		    del_bytes((long)(regmatch.endp[0] - regmatch.startp[0]),
-								       FALSE);
+								FALSE, FALSE);
 		    ins_str(repl_text);
 		}
 	    }
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -342,11 +342,8 @@ mch_inchar(buf, maxlen, wtime, tb_change
 	if (WaitForChar(p_ut) == 0)
 	{
 #ifdef FEAT_AUTOCMD
-	    if (!did_cursorhold
-		    && has_cursorhold()
-		    && get_real_state() == NORMAL_BUSY
-		    && maxlen >= 3
-		    && !typebuf_changed(tb_change_cnt))
+	    if (trigger_cursorhold() && maxlen >= 3
+					   && !typebuf_changed(tb_change_cnt))
 	    {
 		buf[0] = K_SPECIAL;
 		buf[1] = KS_EXTRA;
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -1383,8 +1383,7 @@ mch_inchar(
 	if (!WaitForChar(p_ut))
 	{
 #ifdef FEAT_AUTOCMD
-	    if (!did_cursorhold && has_cursorhold()
-			    && get_real_state() == NORMAL_BUSY && maxlen >= 3)
+	    if (trigger_cursorhold() && maxlen >= 3)
 	    {
 		buf[0] = K_SPECIAL;
 		buf[1] = KS_EXTRA;