Hi Bram and list,
2016-3-11(Fri) 6:20:14 UTC+9 Bram Moolenaar:
> Thinca wrote:
>
> > :help feedkeys() says,
> >
> > 'x' Execute commands until typeahead is empty. This is
> > similar to using ":normal!". You can call feedkeys()
> > several times without 'x' and then one time with 'x'
> > (possibly with an empty {string}) to execute all the
> > typeahead.
> >
> > > possibly with an empty {string}
> >
> > But feedkeys('', 'x') doesn't work.
> >
> > I wrote a patch which fix this. I also added test.
> > Please check the gist below.
> >
> > https://gist.github.com/thinca/c3215460ebca3043529c
>
> Thanks. The test works, but it has a one second delay.
> I don't see an obvious reason for that.
I investigated a little.
The wait one second place is here.
#0 0x00000000005731d9 in check_for_delay (check_msg_scroll=1) at screen.c:8377
#1 0x00000000004246bc in edit (cmdchar=105, startln=0, count=1) at edit.c:353
#2 0x000000000050dd16 in invoke_edit (cap=0x7ffd592931b0, repl=0, cmd=105, star
tln=0) at normal.c:9036
#3 0x000000000050dcb3 in nv_edit (cap=0x7ffd592931b0) at normal.c:9009
#4 0x00000000004ff8d1 in normal_cmd (oap=0x7ffd59293280, toplevel=1)
at normal.c:1149
#5 0x0000000000486330 in exec_normal (was_typed=1) at ex_docmd.c:10075
#6 0x0000000000447084 in f_feedkeys (argvars=0x7ffd592934b0, rettv=0x7ffd592936
70) at eval.c:11872
#7 0x000000000044181b in call_func (funcname=0xf8f310 "feedkeys", len=8, rettv=
0x7ffd59293670, argcount=2, argvars=0x7ffd592934b0, firstline=1, lastline=1, doe
srange=0x7ffd5929366c, evaluate=1, selfdict=0x0) at eval.c:8927
#8 0x0000000000441275 in get_func_tv (name=0xf8f310 "feedkeys", len=8, rettv=0x
7ffd59293670, arg=0x7ffd59293690, firstline=1, lastline=1, doesrange=0x7ffd59293
66c, evaluate=1, selfdict=0x0) at eval.c:8726
#9 0x00000000004394bb in ex_call (eap=0x7ffd59293760) at eval.c:3528
#10 0x000000000047a05f in do_one_cmd (cmdlinep=0x7ffd59293df8, sourcing=0, cstac
k=0x7ffd59293950, fgetline=0x49037d <getexline>, cookie=0x0) at ex_docmd.c:2921
#11 0x0000000000476e20 in do_cmdline (cmdline=0x0, fgetline=
0x49037d <getexline>, cookie=0x0, flags=0) at ex_docmd.c:1107
#12 0x0000000000506f1c in nv_colon (cap=0x7ffd59293f20) at normal.c:5325
#13 0x00000000004ff8d1 in normal_cmd (oap=0x7ffd59294000, toplevel=1)
at normal.c:1149
#14 0x0000000000601891 in main_loop (cmdwin=0, noexmode=0) at main.c:1353
#15 0x00000000006011d4 in main (argc=1, argv=0x7ffd59294328) at main.c:1045
screen.c
|8370 check_for_delay(int check_msg_scroll) |
|8371 { |
|8372 if ((emsg_on_display || (check_msg_scroll && msg_scroll)) |
|8373 && !did_wait_return |
|8374 && emsg_silent == 0) |
|8375 { |
|8376 out_flush(); |
>|8377 ui_delay(1000L, TRUE); |
|8378 emsg_on_display = FALSE; |
|8379 if (check_msg_scroll) |
|8380 msg_scroll = FALSE; |
|8381 } |
|8382 }
(gdb) p emsg_on_display
$10 = 0
(gdb) p check_msg_scroll
$11 = 1
(gdb) p msg_scroll
$12 = 1
(gdb) p did_wait_return
$13 = 0
(gdb) p emsg_silent
$14 = 0
How to reproduce:
$ vim -Nu NONE -c 'echo feedkeys("ifoo\<Esc>", "x")'
I will create a solution from now.
Thanks.
--
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.