comparison src/testdir/test_autocmd.vim @ 13142:59a16624400a v8.0.1445

patch 8.0.1445: cannot act on edits in the command line commit https://github.com/vim/vim/commit/153b704e20f9c269450a7d3ea8cafcf942579ab7 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 31 15:48:32 2018 +0100 patch 8.0.1445: cannot act on edits in the command line Problem: Cannot act on edits in the command line. Solution: Add the CmdlineChanged autocommand event. (xtal8, closes https://github.com/vim/vim/issues/2603, closes #2524)
author Christian Brabandt <cb@256bit.org>
date Wed, 31 Jan 2018 16:00:07 +0100
parents a0c6910e7fa4
children 6559e98f3e74
comparison
equal deleted inserted replaced
13141:8510122958cc 13142:59a16624400a
810 bwipe Xfoo 810 bwipe Xfoo
811 bwipe Xbar 811 bwipe Xbar
812 endfunc 812 endfunc
813 813
814 func Test_Cmdline() 814 func Test_Cmdline()
815 au! CmdlineChanged : let g:text = getcmdline()
816 let g:text = 0
817 call feedkeys(":echom 'hello'\<CR>", 'xt')
818 call assert_equal("echom 'hello'", g:text)
819 au! CmdlineChanged
820
821 au! CmdlineChanged : let g:entered = expand('<afile>')
822 let g:entered = 0
823 call feedkeys(":echom 'hello'\<CR>", 'xt')
824 call assert_equal(':', g:entered)
825 au! CmdlineChanged
826
815 au! CmdlineEnter : let g:entered = expand('<afile>') 827 au! CmdlineEnter : let g:entered = expand('<afile>')
816 au! CmdlineLeave : let g:left = expand('<afile>') 828 au! CmdlineLeave : let g:left = expand('<afile>')
817 let g:entered = 0 829 let g:entered = 0
818 let g:left = 0 830 let g:left = 0
819 call feedkeys(":echo 'hello'\<CR>", 'xt') 831 call feedkeys(":echo 'hello'\<CR>", 'xt')