[vim] Fix test_utf8 fails at AppVeyor. (dirty workaround) (#493)

39 views
Skip to first unread message

h_east

unread,
Nov 22, 2015, 2:45:10 AM11/22/15
to vim/vim

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:

  • 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?

Best regards,
Hirohito Higashi (a.k.a h_east)


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/493

Commit Summary

  • Fix test_utf8 fails at AppVeyor. (dirty workaround)

File Changes

Patch Links:


Reply to this email directly or view it on GitHub.

Bram Moolenaar

unread,
Nov 22, 2015, 9:09:50 AM11/22/15
to vim/vim

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.

--
hundred-and-one symptoms of being an internet addict:
124. You begin conversations with, "Who is your internet service provider?"

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

h_east

unread,
Nov 22, 2015, 10:39:41 AM11/22/15
to vim_dev, v...@noreply.github.com, reply+00b1d19831f0183984b628279a8c3e263632969...@reply.github.com, vim-dev...@256bit.org
Hi, Bram

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.

--

h_east

unread,
Nov 22, 2015, 7:57:42 PM11/22/15
to vim/vim, vim-dev ML

Closed #493.

h_east

unread,
Nov 22, 2015, 7:57:42 PM11/22/15
to vim/vim, vim-dev ML

AppVeyor was PASS by the correct fix. so I close this PR. Thank you.

Reply all
Reply to author
Forward
0 new messages