I am trying to use feedkeys() to give input to a Vim command that is
expecting input from the user, and it works if the command is not
executed using :silent prefix. Here is an example (executed on JDK 1.4.2
source):

:ta Integer
tag 1 of 11 or more
:call feedkeys("4\<CR>") | ts
<takes me to the 4th tag>

If I prefix the :ts command with :silent, this doesn't work, and the fed
keys are handled by Vim as normal mode commands.

:call feedkeys("4\<CR>") | silent ts

I was doing this (feeding keys) in Vim 6.3 using a dynamic mapping,
which suffered from the same problem, so had to use the command without
silent, and that is a big usability issue, so was really hoping that
feedkeys() will solve this problem, but unfortuately it doesn't.

Also, I just observed that while experimenting with feedkeys(), Vim went
into a loop. It responds to ^C with a beep, but ignores all my other
keys. It essentially stopped responding to user input (keyboard and
mouse), but quit gracefully when I hit the window close button. Here is
how to reproduce it (again using JDK 1.4.2 source, but should work on
any tags):

:ta Integer
:ta Integer
:call feedkeys("4\<CR>") | silent ts
^T
:call feedkeys("4\<CR>") | silent ts
E426: tag not found: Integer
<non-responding Vim>

The "^T" is to return back to the previous tag in the stack.

-- 
Thanks,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to