Hi Bram!
On Di, 06 Sep 2016, Bram Moolenaar wrote:
>
> Christian Brabandt wrote:
>
> > 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, but have
> > it not finished/aborted the first call, so that in the end this command
> > is executed:
> > d12l where a cursorhold command triggered after the 1
> >
> > Does that sound possible or should we not worry about those special case
> > (see normal.c:602)
>
> I suppose there are cases where we want for something to happen, be it a
> CursorHold event or a timer. And then continue. But that is not
> possible with two feedkeys() calls, because after the second you can't
> go back to the code where it was waiting for the next character.
>
> I haven't tried this, but could you call feedkeys() in the CursorHold
> command? So it feeds the next characters to read? Could try the same
> in a timer callback.
This does not seem to work:
func! Test_normal47_autocmd()
" disabled, does not seem to be possible currently
new
call append(0, repeat('-',20))
set updatetime=20
au CursorHold * call feedkeys('2l', 'ix')
" should delete 12 chars
call feedkeys('d1', 'x!')
call assert_equal('--------', getline(1))
endfu
I just let it skip for now.
Best,
Christian
--
Wußten Sie schon...
... daß das Dezimalsystem niemals so erfolgreich gewesen
wäre, wenn der Mensch keine zehn Finger hätte?
--
--
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.