diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-01-31 15:48:32 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-01-31 15:48:32 +0100 |
commit | 153b704e20f9c269450a7d3ea8cafcf942579ab7 (patch) | |
tree | ab9438b2370889b2f49320fae762525be1ad3562 /src/testdir/test_autocmd.vim | |
parent | ec0557f08b2660118eaedb94471e5ab0f87cf2a3 (diff) | |
download | vim-git-153b704e20f9c269450a7d3ea8cafcf942579ab7.tar.gz |
patch 8.0.1445: cannot act on edits in the command linev8.0.1445
Problem: Cannot act on edits in the command line.
Solution: Add the CmdlineChanged autocommand event. (xtal8, closes #2603,
closes #2524)
Diffstat (limited to 'src/testdir/test_autocmd.vim')
-rw-r--r-- | src/testdir/test_autocmd.vim | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index d8fddffeb..b7d43b59a 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -812,6 +812,18 @@ func Test_QuitPre() endfunc func Test_Cmdline() + au! CmdlineChanged : let g:text = getcmdline() + let g:text = 0 + call feedkeys(":echom 'hello'\<CR>", 'xt') + call assert_equal("echom 'hello'", g:text) + au! CmdlineChanged + + au! CmdlineChanged : let g:entered = expand('<afile>') + let g:entered = 0 + call feedkeys(":echom 'hello'\<CR>", 'xt') + call assert_equal(':', g:entered) + au! CmdlineChanged + au! CmdlineEnter : let g:entered = expand('<afile>') au! CmdlineLeave : let g:left = expand('<afile>') let g:entered = 0 |