]> granicus.if.org Git - vim/commitdiff
patch 7.4.1692 v7.4.1692
authorBram Moolenaar <Bram@vim.org>
Fri, 1 Apr 2016 19:00:48 +0000 (21:00 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 1 Apr 2016 19:00:48 +0000 (21:00 +0200)
Problem:    feedkeys('i', 'x') gets stuck, waits for a character to be typed.
Solution:   Behave like ":normal". (Yasuhiro Matsumoto)

src/eval.c
src/testdir/test_feedkeys.vim
src/version.c

index b2f4462f3fa920b25a138e57b58b3056c54eda0a..e1d69d00deed08d14c68ee7dbf6a1ba473164588 100644 (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. */
                msg_scroll = FALSE;
+
+               ++ex_normal_busy;
                exec_normal(TRUE);
+               --ex_normal_busy;
                msg_scroll |= save_msg_scroll;
            }
        }
index 33cd58949d688200e541031e50e0969f6eda2748..70500f2bb571fa290b605adad5044cea1d666f91 100644 (file)
@@ -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
index d08e7307b6777da19e5a3a64412df56687578615..c1e8fb7b916fe58bc1ff6e6ee10fbeafd5ddeffd 100644 (file)
@@ -748,6 +748,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1692,
 /**/
     1691,
 /**/