4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Insert mode completion works when typed but not when replayed from
12 a register. (Hari Krishna Dara)
13 Also: Mappings for Insert mode completion don't always work.
14 Solution: When finding a non-completion key in the input don't interrupt
15 completion when it wasn't typed.
16 Do use mappings when checking for typeahead while still finding
17 completions. Avoids that completion is interrupted too soon.
18 Use "compl_pending" in a different way.
22 *** ../vim-7.0.034/src/edit.c Fri Jun 23 17:59:26 2006
23 --- src/edit.c Fri Jun 23 21:32:42 2006
27 if (compl_shows_dir == FORWARD && compl_shown_match->cp_next != NULL)
29 - if (compl_pending != 0)
31 compl_shown_match = compl_shown_match->cp_next;
32 found_end = (compl_first_match != NULL
33 && (compl_shown_match->cp_next == compl_first_match
37 else if (compl_shows_dir == BACKWARD
38 && compl_shown_match->cp_prev != NULL)
40 - if (compl_pending != 0)
42 found_end = (compl_shown_match == compl_first_match);
43 compl_shown_match = compl_shown_match->cp_prev;
44 found_end |= (compl_shown_match == compl_first_match);
50 if (compl_shows_dir == BACKWARD)
52 else if (compl_shows_dir == BACKWARD
53 && compl_shown_match->cp_prev != NULL)
55 found_end = (compl_shown_match == compl_first_match);
56 compl_shown_match = compl_shown_match->cp_prev;
57 found_end |= (compl_shown_match == compl_first_match);
61 + if (!allow_get_expansion)
65 + if (compl_shows_dir == BACKWARD)
66 + compl_pending -= todo + 1;
68 + compl_pending += todo + 1;
75 if (compl_shows_dir == BACKWARD)
81 - if (!allow_get_expansion)
85 num_matches = ins_compl_get_exp(&compl_startpos);
86 ! if (compl_pending != 0 && compl_direction == compl_shows_dir
88 ! compl_shown_match = compl_curr_match;
91 if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
98 num_matches = ins_compl_get_exp(&compl_startpos);
100 ! /* handle any pending completions */
101 ! while (compl_pending != 0 && compl_direction == compl_shows_dir
104 ! if (compl_pending > 0 && compl_shown_match->cp_next != NULL)
106 ! compl_shown_match = compl_shown_match->cp_next;
109 ! if (compl_pending < 0 && compl_shown_match->cp_prev != NULL)
111 ! compl_shown_match = compl_shown_match->cp_prev;
119 if ((compl_shown_match->cp_flags & ORIGINAL_TEXT) == 0
130 if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R)
135 ! /* Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key()
136 ! * can't do its work correctly. */
140 if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R)
143 (void)ins_compl_next(FALSE, ins_compl_key2count(c),
144 c != K_UP && c != K_DOWN);
146 ! else if (c != Ctrl_R)
147 ! compl_interrupted = TRUE;
149 if (compl_pending != 0 && !got_int)
150 ! (void)ins_compl_next(FALSE, compl_pending > 0
151 ! ? compl_pending : -compl_pending, TRUE);
156 (void)ins_compl_next(FALSE, ins_compl_key2count(c),
157 c != K_UP && c != K_DOWN);
161 ! /* Need to get the character to have KeyTyped set. We'll put it
162 ! * back with vungetc() below. */
165 ! /* Don't interrupt completion when the character wasn't typed,
166 ! * e.g., when doing @q to replay keys. */
167 ! if (c != Ctrl_R && KeyTyped)
168 ! compl_interrupted = TRUE;
173 if (compl_pending != 0 && !got_int)
175 ! int todo = compl_pending > 0 ? compl_pending : -compl_pending;
178 ! (void)ins_compl_next(FALSE, todo, TRUE);
183 *** ../vim-7.0.034/src/version.c Fri Jun 23 17:59:26 2006
184 --- src/version.c Fri Jun 23 21:35:39 2006
188 { /* Add new patch number below this line */
194 So when I saw the post to comp.editors, I rushed over to the FTP site to
195 grab it. So I yank apart the tarball, light x candles, where x= the
196 vim version multiplied by the md5sum of the source divided by the MAC of
197 my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights,
198 wave a dead chicken over the hard drive, and summon the power of GNU GCC
199 with the magic words "make config ; make!".
200 [Jason Spence, compiling Vim 5.0]
202 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
203 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
204 \\\ download, build and distribute -- http://www.A-A-P.org ///
205 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///