aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_autocmd.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/testdir/test_autocmd.vim')
-rw-r--r--src/nvim/testdir/test_autocmd.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_autocmd.vim b/src/nvim/testdir/test_autocmd.vim
index 835df42a10..82c04abf5b 100644
--- a/src/nvim/testdir/test_autocmd.vim
+++ b/src/nvim/testdir/test_autocmd.vim
@@ -420,3 +420,25 @@ function Test_autocmd_bufwipe_in_SessLoadPost2()
call delete(file)
endfor
endfunc
+
+func Test_Cmdline()
+ au! CmdlineEnter : let g:entered = expand('<afile>')
+ au! CmdlineLeave : let g:left = expand('<afile>')
+ let g:entered = 0
+ let g:left = 0
+ call feedkeys(":echo 'hello'\<CR>", 'xt')
+ call assert_equal(':', g:entered)
+ call assert_equal(':', g:left)
+ au! CmdlineEnter
+ au! CmdlineLeave
+
+ au! CmdlineEnter / let g:entered = expand('<afile>')
+ au! CmdlineLeave / let g:left = expand('<afile>')
+ let g:entered = 0
+ let g:left = 0
+ call feedkeys("/hello<CR>", 'xt')
+ call assert_equal('/', g:entered)
+ call assert_equal('/', g:left)
+ au! CmdlineEnter
+ au! CmdlineLeave
+endfunc