Wednesday, June 19, 2013

Re: mappings time out bug?

On Wednesday, June 19, 2013 7:39:26 AM UTC-4, JohnBeckett wrote:
> Has this issue been sorted out? Let's not work out who-said-
>
> what.
>
>
>
> The OP was:
>
>
>
> > nnoremap gp `[v`]
>
> >
>
> > since 'g' is not mapped, it shouldn't timeout no matter what
>
> > the timeout length is right? As expected, the built in mapping
>
> > for gp, gv, etc. both work no matter how long one waits
>
> > between the g and the p.
>
>
>
> My thoughts are that by default, and as per ":help gp", there
>
> is no gp mapping, so you can press g, then wait a minute, then
>
> press p (no timeout).
>
>
>
> However, once you have a mapping (the nnoremap above), the
>
> situation is completely changed. The timeout does apply to the
>
> mapping, and you would have to type gp quickly for the g to have
>
> any effect.

I think I overreacted on a rather minor issue which is probably the norm for these semi-anonymous online issues and for someone as anal as I mam. It's quirky behavior that's mostly undocumented but it confused me and I spent a long time trying to figure it out, and this process of figuring it out did not seem all that rewarding. To me, it sounds like you are defending vim for wasting my time, but of course there are other perspectives as well :-D

I'd be content with letting this rest, it will probably go on to confuse future generations. There is an easy fix of course, something along the lines of:

nnoremap g :call MyGFunction()
fun! MyGFunction
let c=getchar()
if c==char2nr('p')
norm! `[v]`
else
exe 'norm! g'.c
en
endfun

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: