I've noticed that pressing <CTRL-G> while in visual mode,
causes vim to take 100% of the CPU.
I can interrupt it with <CTRL-C>.
Anybody else observing that?
Steps to reproduce bug:
1/ press v command to enter visual mode
2/ press <CTRL-G>
3/ observe that vim takes 100% of CPU
I'm using vim-7.1 (patches 1-241) on Linux x86 built
with "configure --with-features=huge".
-- Dominique
Not me. 7.1.203
Ben.
Send instant messages to your online friends http://au.messenger.yahoo.com
> > I've noticed that pressing <CTRL-G> while in visual mode,
> > causes vim to take 100% of the CPU.
> >
> > I can interrupt it with <CTRL-C>.
> >
> > Anybody else observing that?
>
> Not me. 7.1.203
>
> Ben.
Ah, sorry, false alert. Investigating further, I found the root cause,
I had a silly recursive mapping in my ~/.vimrc:
map <c-g> 2<c-g>
I can't remember why I had such a senseless mapping. I suspect
it was meant to be:
map <c-g> g<c-g>
I never use <ctrl-g> and did not notice the problem until today.
I've removed the offending mapping from my ~/.vimrc and everything
is now OK.
Creating such a recursive mapping should perhaps give an error,
rather than causing infinite loops when triggering the mapping.
-- Dominique
Use ":noremap" instead and there will be no infinite loop.
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
254. You wake up daily with your keyboard printed on your forehead.
The infinite loop is actually a feature, and documented.
:help recursive_mapping
No, it was meant to be
noremap <c-g> 2<c-g>
2<c-g> shows more information than <c-g>. It's briefly mentioned at
:help CTRL-g.
The output of <c-g>:
".vimrc" line 1 of 427 --0%-- col 1
The output of 1<c-g>:
"~/.vimrc" line 1 of 427 --0%-- col 1
The output of 2<c-g>:
buf 1: "~/.vimrc" line 1 of 427 --0%-- col 1
~Matt