4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When the press-enter prompt gets a character from a non-remappable
12 mapping, it's put back in the typeahead buffer as remappable,
13 which may cause an endless loop.
14 Solution: Restore the non-remappable flag and the silent flag when putting a
15 char back in the typeahead buffer.
16 Files: src/getchar.c, src/message.c, src/normal.c
19 *** ../vim-7.0.176/src/getchar.c Tue Oct 3 15:36:09 2006
20 --- src/getchar.c Tue Dec 5 21:17:42 2006
24 static mapblock_T *first_abbr = NULL; /* first entry in abbrlist */
26 ! static int KeyNoremap = FALSE; /* remapping disabled */
29 * variables used by vgetorpeek() and flush_buffers()
32 static mapblock_T *first_abbr = NULL; /* first entry in abbrlist */
34 ! static int KeyNoremap = 0; /* remapping flags */
37 * variables used by vgetorpeek() and flush_buffers()
42 * Put character "c" back into the typeahead buffer.
43 * Can be used for a character obtained by vgetc() that needs to be put back.
44 + * Uses cmd_silent, KeyTyped and KeyNoremap to restore the flags belonging to
54 ! (void)ins_typebuf(buf, REMAP_YES, 0, !KeyTyped, FALSE);
62 ! (void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
68 gotchars(typebuf.tb_buf
71 ! KeyNoremap = (typebuf.tb_noremap[
73 ! & (RM_NONE|RM_SCRIPT));
76 break; /* got character, break for loop */
78 gotchars(typebuf.tb_buf
81 ! KeyNoremap = typebuf.tb_noremap[
85 break; /* got character, break for loop */
89 if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
91 ! if (KeyNoremap) /* no remapping implies no abbreviation */
97 if (typebuf.tb_no_abbr_cnt) /* abbrev. are not recursive */
99 ! if ((KeyNoremap & (RM_NONE|RM_SCRIPT)) != 0)
100 ! /* no remapping implies no abbreviation */
104 *** ../vim-7.0.176/src/normal.c Tue Nov 7 18:43:10 2006
105 --- src/normal.c Tue Dec 5 21:16:07 2006
108 /* Fake a "c"hange command. When "restart_edit" is set (e.g., because
109 * 'insertmode' is set) fake a "d"elete command, Insert mode will
110 * restart automatically.
111 ! * Insert the typed character in the typeahead buffer, so that it will
112 ! * be mapped in Insert mode. Required for ":lmap" to work. May cause
113 ! * mapping a character from ":vnoremap"... */
115 if (restart_edit != 0)
118 /* Fake a "c"hange command. When "restart_edit" is set (e.g., because
119 * 'insertmode' is set) fake a "d"elete command, Insert mode will
120 * restart automatically.
121 ! * Insert the typed character in the typeahead buffer, so that it can
122 ! * be mapped in Insert mode. Required for ":lmap" to work. */
124 if (restart_edit != 0)
126 *** ../vim-7.0.176/src/version.c Tue Dec 5 21:32:00 2006
127 --- src/version.c Tue Dec 5 21:36:07 2006
131 { /* Add new patch number below this line */
137 5 out of 4 people have trouble with fractions.
139 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
140 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
141 \\\ download, build and distribute -- http://www.A-A-P.org ///
142 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///