Skip to content

Commit ef3b4cb

Browse files
brammooldouglaskayama
authored andcommitted
updated for version 7.4.601
Problem: It is not possible to have feedkeys() insert characters. Solution: Add the 'i' flag.
1 parent ce17086 commit ef3b4cb

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

runtime/doc/eval.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 7.4. Last change: 2014 Dec 07
1+
*eval.txt* For Vim version 7.4. Last change: 2015 Jan 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2965,9 +2965,12 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
29652965

29662966
feedkeys({string} [, {mode}]) *feedkeys()*
29672967
Characters in {string} are queued for processing as if they
2968-
come from a mapping or were typed by the user. They are added
2969-
to the end of the typeahead buffer, thus if a mapping is still
2970-
being executed these characters come after them.
2968+
come from a mapping or were typed by the user.
2969+
By default the string is added to the end of the typeahead
2970+
buffer, thus if a mapping is still being executed the
2971+
characters come after them. Use the 'i' flag to insert before
2972+
other characters, they will be executed next, before any
2973+
characters from a mapping.
29712974
The function does not wait for processing of keys contained in
29722975
{string}.
29732976
To include special keys into {string}, use double-quotes
@@ -2981,6 +2984,7 @@ feedkeys({string} [, {mode}]) *feedkeys()*
29812984
't' Handle keys as if typed; otherwise they are handled as
29822985
if coming from a mapping. This matters for undo,
29832986
opening folds, etc.
2987+
'i' Insert the string instead of appending (see above).
29842988
Return value is always 0.
29852989

29862990
filereadable({file}) *filereadable()*

src/eval.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10500,6 +10500,7 @@ f_feedkeys(argvars, rettv)
1050010500
typval_T *rettv UNUSED;
1050110501
{
1050210502
int remap = TRUE;
10503+
int insert = FALSE;
1050310504
char_u *keys, *flags;
1050410505
char_u nbuf[NUMBUFLEN];
1050510506
int typed = FALSE;
@@ -10524,6 +10525,7 @@ f_feedkeys(argvars, rettv)
1052410525
case 'n': remap = FALSE; break;
1052510526
case 'm': remap = TRUE; break;
1052610527
case 't': typed = TRUE; break;
10528+
case 'i': insert = TRUE; break;
1052710529
}
1052810530
}
1052910531
}
@@ -10534,7 +10536,7 @@ f_feedkeys(argvars, rettv)
1053410536
if (keys_esc != NULL)
1053510537
{
1053610538
ins_typebuf(keys_esc, (remap ? REMAP_YES : REMAP_NONE),
10537-
typebuf.tb_len, !typed, FALSE);
10539+
insert ? 0 : typebuf.tb_len, !typed, FALSE);
1053810540
vim_free(keys_esc);
1053910541
if (vgetc_busy)
1054010542
typebuf_was_filled = TRUE;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,8 @@ static char *(features[]) =
741741

742742
static int included_patches[] =
743743
{ /* Add new patch number below this line */
744+
/**/
745+
601,
744746
/**/
745747
600,
746748
/**/

0 commit comments

Comments
 (0)