aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2017-11-22 22:35:20 +0100
committerGitHub <noreply@github.com>2017-11-22 22:35:20 +0100
commita4f6cec7a31ff8dbfa089b9e22227afbeb951e9b (patch)
tree9bcf55ca9e4ecdbea9390dc750d39027ba7d3acf /src/nvim/testdir
parent9393be477a733183c2a992cc8728e3ebc65a3118 (diff)
downloadrneovim-a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b.tar.gz
rneovim-a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b.tar.bz2
rneovim-a4f6cec7a31ff8dbfa089b9e22227afbeb951e9b.zip
cmdline: CmdlineEnter and CmdlineLeave autocommands (#7422)
vim-patch:fafcf0dd59fd patch 8.0.1206: no autocmd for entering or leaving the command line Problem: No autocmd for entering or leaving the command line. Solution: Add CmdlineEnter and CmdlineLeave. https://github.com/vim/vim/commit/fafcf0dd59fd9c4ef743bb333ae40d1d322b6079
Diffstat (limited to 'src/nvim/testdir')
-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