From: Bram Moolenaar Date: Fri, 1 Apr 2016 19:00:48 +0000 (+0200) Subject: patch 7.4.1692 X-Git-Tag: v7.4.1692 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9bd547aca41799605c3a3f83444f6725c2d6eda9;p=vim 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 index b2f4462f3..e1d69d00d 100644 --- a/src/eval.c +++ b/src/eval.c @@ -11368,7 +11368,10 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED) /* 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 index 33cd58949..70500f2bb 100644 --- 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 index d08e7307b..c1e8fb7b9 100644 --- a/src/version.c +++ b/src/version.c @@ -748,6 +748,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1692, /**/ 1691, /**/