1
0
forked from aniani/vim

patch 7.4.1692

Problem:    feedkeys('i', 'x') gets stuck, waits for a character to be typed.
Solution:   Behave like ":normal". (Yasuhiro Matsumoto)
This commit is contained in:
Bram Moolenaar
2016-04-01 21:00:48 +02:00
parent b681be175b
commit 9bd547aca4
3 changed files with 9 additions and 0 deletions

View File

@@ -11368,7 +11368,10 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
/* Avoid a 1 second delay when the keys start Insert mode. */ /* Avoid a 1 second delay when the keys start Insert mode. */
msg_scroll = FALSE; msg_scroll = FALSE;
++ex_normal_busy;
exec_normal(TRUE); exec_normal(TRUE);
--ex_normal_busy;
msg_scroll |= save_msg_scroll; msg_scroll |= save_msg_scroll;
} }
} }

View File

@@ -6,5 +6,9 @@ func Test_feedkeys_x_with_empty_string()
call assert_equal('', getline('.')) call assert_equal('', getline('.'))
call feedkeys('', 'x') call feedkeys('', 'x')
call assert_equal('foo', getline('.')) call assert_equal('foo', getline('.'))
" check it goes back to normal mode immediately.
call feedkeys('i', 'x')
call assert_equal('foo', getline('.'))
quit! quit!
endfunc endfunc

View File

@@ -748,6 +748,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1692,
/**/ /**/
1691, 1691,
/**/ /**/