Hi 'Andy!

On Do, 08 Sep 2016, 'Andy Wokula' via vim_dev wrote:

> Am 06.09.2016 um 20:42 schrieb Christian Brabandt:
> >Bram,
> >if in a test we do this:
> >     call feedkeys('d1', 'x!')
> >     call feedkeys('2l', 'x')
> >
> >Vim will stay in the first feedkeys() call and wait for input.
> >
> >I'd like to have feedkeys() return after CursorHold triggered,
> 
> You say Vim waits for input ... how does it trigger CursorHold then?

CusorHold is only triggered, if Vim is waiting for input. The problem 
however in the tests is, that the keyboard buffer is never empty, so we 
can't really test the CursorHold autocommand. Therefor Bram added the 
'!' flat to the feedkeys() function. This will consume the complete 
buffer and keep Vim in a state where it will wait for further input.

Look into src/testdir/test_autocmd.vim in the Vim source repository. It 
works around that by executing a timer command, that adds an <esc> to 
the typebuf and so the test can continue.

> >Does that sound possible or should we not worry about those special case
> >(see normal.c:602)

I currently have this test skipped. I haven't posted the changes to 
test_normal.vim yes, as I am slowly going through 
https://coveralls.io/builds/7763791/source?filename=src%2Fnormal.c and 
add tests where I think we could need more.

Best,
Christian
-- 
Der beliebteste Fehler unter den Leuten, die etwas absolut
idiotensicheres konstruieren wollen ist der, daß sie den
Erfindungsreichtum von absoluten Idioten unterschätzen.
                -- Douglas Adams

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui