Mercurial > vim
comparison src/testdir/test_autocmd.vim @ 12656:0a9dacb8826a v8.0.1206
patch 8.0.1206: no autocmd for entering or leaving the command line
commit https://github.com/vim/vim/commit/fafcf0dd59fd9c4ef743bb333ae40d1d322b6079
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 19 18:35:51 2017 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 19 Oct 2017 18:45:05 +0200 |
parents | 272ecbaf1b4f |
children | 15f0f9f16cd9 |
comparison
equal
deleted
inserted
replaced
12655:6963f5ca8813 | 12656:0a9dacb8826a |
---|---|
791 | 791 |
792 unlet g:afile | 792 unlet g:afile |
793 bwipe Xfoo | 793 bwipe Xfoo |
794 bwipe Xbar | 794 bwipe Xbar |
795 endfunc | 795 endfunc |
796 | |
797 func Test_Cmdline() | |
798 au! CmdlineEnter : let g:entered = expand('<afile>') | |
799 au! CmdlineLeave : let g:left = expand('<afile>') | |
800 let g:entered = 0 | |
801 let g:left = 0 | |
802 call feedkeys(":echo 'hello'\<CR>", 'xt') | |
803 call assert_equal(':', g:entered) | |
804 call assert_equal(':', g:left) | |
805 au! CmdlineEnter | |
806 au! CmdlineLeave | |
807 | |
808 au! CmdlineEnter / let g:entered = expand('<afile>') | |
809 au! CmdlineLeave / let g:left = expand('<afile>') | |
810 let g:entered = 0 | |
811 let g:left = 0 | |
812 call feedkeys("/hello<CR>", 'xt') | |
813 call assert_equal('/', g:entered) | |
814 call assert_equal('/', g:left) | |
815 au! CmdlineEnter | |
816 au! CmdlineLeave | |
817 endfunc |