This problem is occured by 'feedkeys() with GUI.
Investigated by Yukihiro Nakadaira in 2013 Jul.
vim-jp/issues#429 (comment) (Sorry in Japanese)
I tried to translate to rough.
Proccess flow is getcmdline () -> setmouse () -> update_mouseshape () -> char_avail ().
On GUI, Called char_avail() by cursor update in the last of getcmdline().
So ':' of the next line is read into the type-ahead-buffer before execution of feedkeys().
My solution:
It's dirty... :-)
Best regards,
Hirohito Higashi (a.k.a h_east)
https://github.com/vim/vim/pull/493
—
Reply to this email directly or view it on GitHub.![]()
2015-11-22(Sun) 23:09:50 UTC+9 Bram Moolenaar:
> Hirohito Higashi wrote:
>
>
>
> > This problem is occured by 'feedkeys() with GUI.
>
> >
>
> > Investigated by Yukihiro Nakadaira in 2013 Jul.
>
> > https://github.com/vim-jp/issues/issues/429#issuecomment-20932913 (Sorry in Japanese)
>
> > I tried to translate to rough.
>
> > > Proccess flow is getcmdline () -> setmouse () -> update_mouseshape () -> char_avail ().
>
> > > On GUI, Called char_avail() by cursor update in the last of getcmdline().
>
> > > So ':' of the next line is read into the type-ahead-buffer before execution of feedkeys().
>
> >
>
> > My solution:
>
> > - The next line of the 'call feedkeys()' is empty. (Only ':')
>
> > - Without '$put=' in the feedkeys(), once I put in a string variable.
>
> > - When the first character equivalent to ':', skip this character.
>
> >
>
> > It's dirty... :-)
>
> > How about this?
>
>
>
> Thanks for figuring out what causes the problem. So the line that has
>
> the call to feedkeys() gets read, but then getcmdline() causes the first
>
> character of the next line to be put in the typeahead buffer. Then the
>
> feedkeys() call puts its string after that character.
>
>
>
> So the simple solution is to tell feedkeys() to insert, using the "i"
>
> flag. I tried it and it fixes the problem for me.
I see! It is great solution!
I think it should be documented for the people to write the test.
Like one:
When you write a test script, Do not use feedkeys() without mode 'i'. Because test runs from mapping.
--
Closed #493.
AppVeyor was PASS by the correct fix. so I close this PR. Thank you.