-
Notifications
You must be signed in to change notification settings - Fork 65
Close popup menu on Esc: do not feed ^E for Esc #40
base: master
Are you sure you want to change the base?
Conversation
What should I do to test the effect of this? |
Make the completion menu popup from insert mode, e.g. via C-X C-O for omni completion, then press Esc. |
Guys, this is on purpose. When you have the popup menu visible all the keys have a different behavior. If you do not want the C-E on popup menu, I'm pretty sure you can configure Autoclose to not behave like that. I'm away from my computer and I can't double check this. --Thiago Alves http://www.thiagoalves.com.br (http://www.thiagoalves.com.br/) [email protected] (mailto:[email protected])"Man's mind, once stretched by a new idea, never regain its original dimensions." On Saturday, September 29, 2012 at 11:43 AM, Daniel Hahler wrote:
|
I'm having the same issue as blueyed and can confirm it's very annoying. Anyway, can override setting |
@Townk "Esc" closes the popup menu and leaves insert mode by default - I do not see why autoclose should change this behavior?! |
Here we get to a delicate subject. Check it out: When a popup menu appears on "any" application, what happens is that the Unfortunately, vim doesn't handle this the way it should. The maps I choose I understand that many people don't like this configuration and that was Also I need to handle this because of all the map I do for the dot preserve. On Sun, Sep 30, 2012 at 5:44 PM, Daniel Hahler [email protected]:
Thiago Alves [email protected]"Man's mind, once stretched by a new idea, never regain its original |
complete_CTRL-E is different from Escape in the popup menu; Escape is meant to close it, while CTRL-E will leave you in insert mode.
Well, you are changing Vim's default behavior by feeding The issue here is not only that Vim stays in insert mode, but that it first exits insert mode (after closing the popup) and then re-enters insert mode after a short delay (less than a second, but annoying). I think that the default in Vim is feasible: The main issue here is probably that after all, the popup can appear automatically (see NeoComplCache or autocomplpop) and that should not cause you to press Esc twice (after waiting ~1s in between). |
I agree with @Townk that the default Vim behavior is wrong and that it should A) leave you in insert mode when you press escape with a popup and B) hitting enter should select the current item and leave the popup. (in fact, I was constantly thrown by the popup behavior until reading this thread, turns out I need to read the help more!) But I also agree with @blueyed that the vim-autoclose plugin shouldn't change the default Vim behavior. vim-autoclose should use the existing mappings, and then another plugin or the user settings should change the popup settings. Basically, vim-autoclose should stick to automatically closing parenthesis and quotes and do nothing else. vim-autoclose changing popup settings is confusing and not what users expect (as evidenced by this conversation). @Townk, you said:
Does this mean that the only way to use vim-autoclose AND get the "correct" popup behavior is through vim-autoclose? Or would it be possible to change vim-autoclose to fallback to the default
|
I figured out a fix that doesn't require having vim-autoclose be in charge of custom mappings for movement characters that are also The fix is to store the old mapping in a plugin specific mapping, and then call it from our new mapping along with the FlushBuffer command. After this, you can run the mappings from my previous comment to get the "correct" vim popup behavior. This allows us to remove all code related to mappings for |
Any updates on this issue? |
I (original reporter) am using https://github.com/Raimondi/delimitMate by now, unsubscribing. |
@blueyed Thanks, I'll give it a try. |
complete_CTRL-E is different from Escape in the popup menu; Escape is
meant to close it, while CTRL-E will leave you in insert mode.