Skip to content

Commit 9bd547a

Browse files
committed
patch 7.4.1692
Problem: feedkeys('i', 'x') gets stuck, waits for a character to be typed. Solution: Behave like ":normal". (Yasuhiro Matsumoto)
1 parent b681be1 commit 9bd547a

3 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/eval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11368,7 +11368,10 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
1136811368

1136911369
/* Avoid a 1 second delay when the keys start Insert mode. */
1137011370
msg_scroll = FALSE;
11371+
11372+
++ex_normal_busy;
1137111373
exec_normal(TRUE);
11374+
--ex_normal_busy;
1137211375
msg_scroll |= save_msg_scroll;
1137311376
}
1137411377
}

src/testdir/test_feedkeys.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ func Test_feedkeys_x_with_empty_string()
66
call assert_equal('', getline('.'))
77
call feedkeys('', 'x')
88
call assert_equal('foo', getline('.'))
9+
10+
" check it goes back to normal mode immediately.
11+
call feedkeys('i', 'x')
12+
call assert_equal('foo', getline('.'))
913
quit!
1014
endfunc

src/version.c

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

749749
static int included_patches[] =
750750
{ /* Add new patch number below this line */
751+
/**/
752+
1692,
751753
/**/
752754
1691,
753755
/**/

0 commit comments

Comments
 (0)