// that occurs while typing a command should
// cause the command not to be executed.
- if (stuff_empty() && typebuf.tb_len == 0)
+ if (ex_normal_busy == 0 && stuff_empty() && typebuf.tb_len == 0)
// There is no pending input from sources other than user input, so
// Vim is going to wait for the user to type a key. Consider the
// command line typed even if next key will trigger a mapping.
call assert_equal("echo 'bar'", histget(':', -1))
call assert_equal("echo 'foo'", histget(':', -2))
+ let g:cmdline = ''
" This command comes completely from a mapping.
nmap <F3> :echo 'baz'<F2><CR>
call feedkeys("\<F3>", 'tx')
call assert_equal("echo 'bar'", histget(':', -1))
call assert_equal("echo 'foo'", histget(':', -2))
+ let g:cmdline = ''
+ " A command coming from :normal is ignored in the history even if the keys
+ " don't explicitly leave Cmdline mode.
+ exe "normal :echo 'baz'\<F2>"
+ call assert_equal("echo 'baz'", g:cmdline)
+ call assert_equal("echo 'bar'", @:)
+ call assert_equal("echo 'bar'", histget(':', -1))
+ call assert_equal("echo 'foo'", histget(':', -2))
+
if has('unix')
new
call setline(1, ['aaa'])