Christian Brabandt wrote:
> On Di, 09 Feb 2016, Bram Moolenaar wrote:
>
> > Only noticed this after sending out my fix. We could do both of them.
> >
> > I was trying to write a test for the fix, but autocommands are not
> > triggered when there is typeahead. We probably need some kind of
> > special support for tests to pretend there is no typeahead. Perhaps
> > inserting some special character, e.g. "\<Wait>". Would work a bit like
> > <Nop> but make char_avail() return false.
>
> I rather not mess with getchar.c as long as I am not sure, how to
> correctly test this. I trust you more in this regards.
Looking at vgetorpeek() it's going to be tricky. It returns one byte at
a time and a special key takes three bytes. Checking for a specific
special key would require advancing, but some special keys are handled
in vgetc().
It's simpler to make char_avail() return false.
call disable_char_avail_for_testing(1)
exe "normal ..."
call disable_char_avail_for_testing(0)
Ugly but straightforward.
Oh, I found that your solution to call update_curswant() in getcurpos()
makes Test_move_cursor() fail. Still seems like your change was good,
perhaps the test is wrong? Yes, it's checking the old version of
curswant.
--
'Psychologist' -- Someone who looks at everyone else when
an attractive woman enters the room.