Yegappan wrote:
> On Tue, Dec 3, 2019 at 10:16 AM Yegappan Lakshmanan <
yega...@gmail.com> wrote:
> >
> > Hi all,
> >
> > While debugging a failure in Appveyor with PR 5307, I found
> > the following. The existing test Test_window_cmd_cmdwin_with_vsp()
> > is interfering with the new Test_yank_block() test. I can reproduce
> > the problem using the following simple function:
> >
> > func Test_window_cmd_cmdwin_with_vsp()
> > call feedkeys("q:\<CR>")
> > new | only!
> > call feedkeys('', 'x')
> > endfunc
> >
> > If I invoke the above function in MS-Windows GUI Vim, I see the
> > following error:
> >
> > :<t_ýT>
> > Error detected while processing function Test_window_cmd_cmdwin_with_vsp:
> > line 3:
> > E488: Trailing characters
> >
> > I couldn't figure out why the special character is getting inserted
> > into the command line. Any suggestions?
> >
>
> I have minimized the steps that triggers this issue to:
>
> :call feedkeys(":q\<CR>", "x")
>
> Just executing the above command triggers the error.
I think you mean ":q\<CR>".
The "q:" sequence is translated to ":" and K_CMDWIN. in
getcmdline_int() there is this code:
if (c == cedit_key || c == K_CMDWIN)
{
if (ex_normal_busy == 0 && got_int == FALSE)
{
/*
* Open a window to edit the command line (and history).
*/
c = open_cmdwin();
some_key_typed = TRUE;
}
}
Since ex_normal_busy is set it won't open the cmdline window, but insert
the key in the command line. The following CR then executes it.
Now I wonder why ex_normal_busy is checked here. Inserting K_CMDWIN
doesn't make sense. We can at least make it:
if ((c == K_CMDWIN || ex_normal_busy == 0) && got_int == FALSE)
Just staying on the safe side, perhaps checking ex_normal_busy can be
removed, but I don't recall why it was added.
--
hundred-and-one symptoms of being an internet addict:
179. You wonder why your household garbage can doesn't have an
"empty recycle bin" button.
/// 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 ///