# HG changeset patch # User vimboss # Date 1134943353 0 # Node ID ba54311bc43ec778a3820fdfbecee8a0f3419610 # Parent def07088c90ec5d838c71cd300a93d945570fe98 updated for version 7.0173 diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt --- 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 and : Accept the currently selected match : Select the previous match, as if CTRL-P was used : Select the next match, as if CTRL-N was used +: Select a match several entries back +: Select a match several entries further The colors of the menu can be changed with these highlight groups: Pmenu normal item |hl-Pmenu| diff --git a/src/fileio.c b/src/fileio.c --- 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 . */ 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 diff --git a/src/gui.c b/src/gui.c --- 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); } } diff --git a/src/os_unix.c b/src/os_unix.c --- 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; diff --git a/src/os_win32.c b/src/os_win32.c --- 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;