On Fri, Apr 14, 2006 at 12:42:53PM +0200, Bram Moolenaar wrote: > > Benji Fisher wrote: > > > I am a few days behind: vim 7.0d (Linux). > > > > I have the text "Mary Ellen" and "May 2" in my buffer. I want to > > type "Mary Ellen" again, so (not noticing the "May 2") I do > > > > Ma<C-P><C-X><C-P> > > > > but that gives me > > > > May 2 > > > > Oops! So I type <BS> a few times (three, to be exact). Much to my > > surprise, I get > > > > May x=EF=BF=BD> =10Ma > > > > (In case it gets garbled in translation, that looks like > > > > May x<99>> ^PMa > > > > to me.) When I repeat the experiment, I get different garbage, so I am > > guessing that there is an uninitialized variable here. > > I guess the state for adding completion isn't reset properly when you > backspace. The patch below makes it work better for me. But I could > not reproduce the "garbage" thus I can't verify that is fixed too.
The patch gets rid of the garbage. There is still a slight problem. After Ma<C-P><C-X><C-P><BS><BS><BS> I now have Ma as expected. The pop-up menu shows "Mary" (selected) and "May", but the buffer just shows "Ma". One <C-P> leaves me with "Ma" and nothing selected in the menu; another gives me "May", and a third gives me "Mary" (with the buffer matching the menu selection). IMO when I have "Ma" in the buffer, nothing should be selected from the pop-up menu. For the sake of users, like me, who are used to the old CTRL-X mode, I suggest the following addition to doc/insert.txt . Maybe a reference to |ins-completion-menu| would be better than the suggested |popupmenu-keys|. Or even rewrite the paragraph about CTRL-X mode above the lines I added. --Benji Fisher *** src/vim70d03/runtime/doc/insert.txt 2006-04-11 16:50:30.000000000 -0400 --- - 2006-04-14 08:47:29.251949000 -0400 *************** *** 1,4 **** ! *insert.txt* For Vim version 7.0d. Last change: 2006 Apr 11 VIM REFERENCE MANUAL by Bram Moolenaar --- 1,4 ---- ! *insert.txt* For Vim version 7.0d. Last change: 2006 Apr 14 VIM REFERENCE MANUAL by Bram Moolenaar *************** *** 590,595 **** --- 590,598 ---- CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next), and CTRL-P (previous). + If 'completeopt' comtains "menu" (the default), then the special meanings + described under |popupmenu-keys| apply. + Also see the 'infercase' option if you want to adjust the case of the match. *complete_CTRL-E*