# HG changeset patch # User Christian Brabandt # Date 1459538105 -7200 # Node ID 6b70b9cdebfc809fe3f2b915f52511b22d60a8b3 # Parent 6b2aa7c200d7f5debccd7741cdf6d93f70143b91 commit https://github.com/vim/vim/commit/9bd547aca41799605c3a3f83444f6725c2d6eda9 Author: Bram Moolenaar Date: Fri Apr 1 21:00:48 2016 +0200 patch 7.4.1692 Problem: feedkeys('i', 'x') gets stuck, waits for a character to be typed. Solution: Behave like ":normal". (Yasuhiro Matsumoto) diff --git a/src/eval.c b/src/eval.c --- a/src/eval.c +++ b/src/eval.c @@ -11368,7 +11368,10 @@ f_feedkeys(typval_T *argvars, typval_T * /* Avoid a 1 second delay when the keys start Insert mode. */ msg_scroll = FALSE; + + ++ex_normal_busy; exec_normal(TRUE); + --ex_normal_busy; msg_scroll |= save_msg_scroll; } } diff --git a/src/testdir/test_feedkeys.vim b/src/testdir/test_feedkeys.vim --- a/src/testdir/test_feedkeys.vim +++ b/src/testdir/test_feedkeys.vim @@ -6,5 +6,9 @@ func Test_feedkeys_x_with_empty_string() call assert_equal('', getline('.')) call feedkeys('', 'x') call assert_equal('foo', getline('.')) + + " check it goes back to normal mode immediately. + call feedkeys('i', 'x') + call assert_equal('foo', getline('.')) quit! endfunc diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -749,6 +749,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1692, +/**/ 1691, /**/ 1690,