4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: The CursorHoldI event only triggers once in Insert mode. It also
12 triggers after CTRL-V and other two-key commands.
13 Solution: Set "did_cursorhold" before getting a second key. Reset
14 "did_cursorhold" after handling a command.
15 Files: src/edit.c, src/fileio.c
18 *** ../vim-7.0.103/src/edit.c Tue Aug 29 18:36:55 2006
19 --- src/edit.c Tue Sep 12 21:12:10 2006
23 lastc = c; /* remember previous char for CTRL-D */
27 + /* Don't want K_CURSORHOLD for the second key, e.g., after CTRL-V. */
28 + did_cursorhold = TRUE;
32 if (p_hkmap && KeyTyped)
33 c = hkmap(c); /* Hebrew mode mapping */
39 } /* end of switch (c) */
42 + /* If typed something may trigger CursorHoldI again. */
43 + if (c != K_CURSORHOLD)
44 + did_cursorhold = FALSE;
47 /* If the cursor was moved we didn't just insert a space */
49 *** ../vim-7.0.103/src/fileio.c Sat Sep 9 14:51:43 2006
50 --- src/fileio.c Tue Sep 12 20:58:55 2006
56 ! if (!did_cursorhold && has_cursorhold() && !Recording)
58 state = get_real_state();
59 if (state == NORMAL_BUSY || (state & INSERT) != 0)
64 ! if (!did_cursorhold && has_cursorhold() && !Recording
65 ! #ifdef FEAT_INS_EXPAND
66 ! && !ins_compl_active()
70 state = get_real_state();
71 if (state == NORMAL_BUSY || (state & INSERT) != 0)
72 *** ../vim-7.0.103/src/version.c Thu Sep 14 10:48:00 2006
73 --- src/version.c Thu Sep 14 11:05:33 2006
77 { /* Add new patch number below this line */
83 A hamburger walks into a bar, and the bartender says: "I'm sorry,
84 but we don't serve food here."
86 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
87 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
88 \\\ download, build and distribute -- http://www.A-A-P.org ///
89 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///