Hi lacygoill,

2016-12-7(Wed) 13:26:25 UTC+9 lacygoill:
> Hello,
> 
> If I write the following in /tmp/vimrc.vim:
> 
> setlocal tw=78
> setlocal cc=78
> 
> "                                                        zzz
> " zzzyyyyyyyyyyyyyyyyyyy
> 
> 
> 
> Then I launch Vim from the shell like this:
> vim -Nu /tmp/vimrc.vim /tmp/vimrc.vim
> 
> 
> Finally, in insert mode I position the cursor after zzz, hit <C-x><C-n> to 
> open the completion menu, hit and <C-e> to exit, here's the result:
> setlocal tw=78
> setlocal cc=78
> 
> "
> zzzyyyyyyyyyyyyyyyyyyyzzz
> " zzzyyyyyyyyyyyyyyyyyyy
> 
> 
> I expected the buffer to not change since I exited the menu. Besides zzz is 
> inserted twice.

I can reproduce it.
Please confirm attached patch.
When confirming is okay, I'll write a test later.  (Maybe write on the weekend 
:-)

Thanks for the reporting.
--
Best regards,
Hirohito Higashi (a.k.a. h_east)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/edit.c b/src/edit.c
index 0d9e9d4..51a12b3 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3875,7 +3875,7 @@ ins_compl_prep(int c)
 		if (prev_col > 0)
 		    dec_cursor();
 		/* only format when something was inserted */
-		if (!arrow_used && !ins_need_undo)
+		if (!arrow_used && !ins_need_undo && c != Ctrl_E)
 		    insertchar(NUL, 0, -1);
 		if (prev_col > 0
 			     && ml_get_curline()[curwin->w_cursor.col] != NUL)

Raspunde prin e-mail lui