Mercurial > vim
comparison src/testdir/test_packadd.vim @ 8402:eed1ca42f9aa v7.4.1492
commit https://github.com/vim/vim/commit/35ca0e7a1cb6e6daef8e0052a8437801226cef19
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 5 17:41:49 2016 +0100
patch 7.4.1492
Problem: No command line completion for ":packadd".
Solution: Implement completion. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 05 Mar 2016 17:45:05 +0100 |
parents | f5972de59001 |
children | 1a6527cce675 |
comparison
equal
deleted
inserted
replaced
8401:98955c2ffd9f | 8402:eed1ca42f9aa |
---|---|
53 " check the path is not added twice | 53 " check the path is not added twice |
54 let new_rtp = &rtp | 54 let new_rtp = &rtp |
55 packadd! mytest | 55 packadd! mytest |
56 call assert_equal(new_rtp, &rtp) | 56 call assert_equal(new_rtp, &rtp) |
57 endfunc | 57 endfunc |
58 | |
59 " Check command-line completion for 'packadd' | |
60 func Test_packadd_completion() | |
61 let optdir1 = &packpath . '/pack/mine/opt' | |
62 let optdir2 = &packpath . '/pack/candidate/opt' | |
63 | |
64 call mkdir(optdir1 . '/pluginA', 'p') | |
65 call mkdir(optdir1 . '/pluginC', 'p') | |
66 call mkdir(optdir2 . '/pluginB', 'p') | |
67 call mkdir(optdir2 . '/pluginC', 'p') | |
68 | |
69 let li = [] | |
70 call feedkeys(":packadd \<Tab>')\<C-B>call add(li, '\<CR>", 't') | |
71 call feedkeys(":packadd " . repeat("\<Tab>", 2) . "')\<C-B>call add(li, '\<CR>", 't') | |
72 call feedkeys(":packadd " . repeat("\<Tab>", 3) . "')\<C-B>call add(li, '\<CR>", 't') | |
73 call feedkeys(":packadd " . repeat("\<Tab>", 4) . "')\<C-B>call add(li, '\<CR>", 'tx') | |
74 call assert_equal("packadd pluginA", li[0]) | |
75 call assert_equal("packadd pluginB", li[1]) | |
76 call assert_equal("packadd pluginC", li[2]) | |
77 call assert_equal("packadd ", li[3]) | |
78 endfunc |