Mercurial > vim
comparison src/testdir/test_cmdline.vim @ 9460:cdffa812f9d1 v7.4.2011
commit https://github.com/vim/vim/commit/aa4d73235bf4deee167aa5314b89ae3d3db334b7
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 9 18:50:29 2016 +0200
patch 7.4.2011
Problem: It is not easy to get a list of command arguments.
Solution: Add getcompletion(). (Yegappan Lakshmanan)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 09 Jul 2016 19:00:06 +0200 |
parents | f92cfcd7fda2 |
children | 7384c0cfad13 |
comparison
equal
deleted
inserted
replaced
9459:b3f970a869d6 | 9460:cdffa812f9d1 |
---|---|
22 | 22 |
23 call delete('Xtestfile1') | 23 call delete('Xtestfile1') |
24 call delete('Xtestfile2') | 24 call delete('Xtestfile2') |
25 set nowildmenu | 25 set nowildmenu |
26 endfunc | 26 endfunc |
27 | |
28 func Test_getcompletion() | |
29 let groupcount = len(getcompletion('', 'event')) | |
30 call assert_true(groupcount > 0) | |
31 let matchcount = len(getcompletion('File', 'event')) | |
32 call assert_true(matchcount > 0) | |
33 call assert_true(groupcount > matchcount) | |
34 | |
35 source $VIMRUNTIME/menu.vim | |
36 let matchcount = len(getcompletion('', 'menu')) | |
37 call assert_true(matchcount > 0) | |
38 let matchcount = len(getcompletion('ToolBar.', 'menu')) | |
39 call assert_true(matchcount > 0) | |
40 | |
41 call assert_fails('call getcompletion("", "burp")', 'E475:') | |
42 endfunc |