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. -- Best regards, Hirohito Higashi (a.k.a h_east) -- -- 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.
