diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-10-19 18:35:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-10-19 18:35:51 +0200 |
commit | fafcf0dd59fd9c4ef743bb333ae40d1d322b6079 (patch) | |
tree | 15b885e7fe89b2cdcf70c2eb33456db7f1f79b77 /src/testdir/test_autocmd.vim | |
parent | ff930cad8a9100eeb04256aab1a14de993c1d7e9 (diff) | |
download | vim-git-fafcf0dd59fd9c4ef743bb333ae40d1d322b6079.tar.gz |
patch 8.0.1206: no autocmd for entering or leaving the command linev8.0.1206
Problem: No autocmd for entering or leaving the command line.
Solution: Add CmdlineEnter and CmdlineLeave.
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index f5a228995..6af0820eb 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -793,3 +793,25 @@ func Test_QuitPre() bwipe Xfoo bwipe Xbar 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 |