Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking on ESC and Backspace key #62

Closed
hameedullah opened this issue Jun 8, 2011 · 7 comments
Closed

Breaking on ESC and Backspace key #62

hameedullah opened this issue Jun 8, 2011 · 7 comments

Comments

@hameedullah
Copy link

For some unknown reason, delimitMate starts breaking on and Backspace key. As soon as I hit key in insert mode it gets out of insert mode and wait for few seconds for me to hit another key, if I hit another key it goes back to insert mode and inserts that key prefixed with "delimitMateEsc". And if I don't hit any key after hitting it times out after few seconds and goes back into insert mode and just inserts "delimitMateEsc".

The behavior with Backspace key is different, when I hit backsapace key in insert mode it just immediately inserts delimitMateBS.

UPDATE:
The above weird situation does not always occur. It only occurs after few minutes of editing and using Vim.

File type is: PHP

@Raimondi
Copy link
Owner

Raimondi commented Jun 8, 2011

When the problem appears, can you paste the output of the following commands here:

:verbose imap <Esc>
:verbose imap <BS>

@hameedullah
Copy link
Author

Output of ":verbose imap <Esc>"
i <Esc>OC <Right>
Last set from ~/.vim/bundle/delimitMate/plugin/delimitMate.vim
i <Esc> * <Plug>delimitMateEsc
Last set from ~/.vim/bundle/lusty/plugin/lusty-juggler.vim

Output of ":verbose imap <BS>"
i <BS> * <Plug>delimitMateBS
Last set from ~/.vim/bundle/lusty/plugin/lusty-juggler.vim

@Raimondi
Copy link
Owner

The problem is that lusty-juggler changes the mapping for its own use and then tries to restore the previous mapping, but that's not reliable and causes problems because lusty-juggler uses :inoremap and delimitMate needs :imap in those cases.

Make sure the problem hasn't been fixed in the latest version and then contact lusty-juggler's maintainer.

@sjbach
Copy link

sjbach commented Jun 12, 2011

Hi Raimondi, not sure that diagnosis is correct. I believe it's a bug in Vim, not in LustyJuggler -- hameedullah, what version of Vim are you running? If it's below 7.3.32 (see the "Included patches" line in the output of vim --version), then you may want to try upgrading and see if that fixes the problem.

@hameedullah
Copy link
Author

Yes, i am using Vim 7.2 the default that comes with Ubuntu 10.04. I will try to upgrade and see if that fixes the issue.

@Raimondi
Copy link
Owner

Hi sjbach, after looking at the requested mappings, I took a quick look into LustyJuggler's code and found this line:

https://github.com/sjbach/lusty/blob/master/plugin/lusty-juggler.vim#L682

It's certainly due to a limitation of Vim (on pre 7.3 versions), but the reported problem was linked to LustyJuggler, not delimitMate. I'd also like to note that keys mapped to <Plug> mappings aren't set with noremap as they need to be expanded, I guess that'd be easy to test and use the correct command when restoring the mapping.

@grota
Copy link
Contributor

grota commented Sep 27, 2011

I believe I have a working fix with https://github.com/grota/lusty/commit/06c84b805f775eb19724ba6d52454be7394127ab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants