Mercurial > vim
comparison src/testdir/test_packadd.vim @ 8528:630300c7a26c v7.4.1554
commit https://github.com/vim/vim/commit/52f9c19015df5ee1ee8592b6f3f15b8a57c8f5be
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 13 13:24:45 2016 +0100
patch 7.4.1554
Problem: Completion for :colorscheme does not use 'packpath'.
Solution: Make it work, add a test. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 13 Mar 2016 13:30:04 +0100 |
parents | 981cc3bef9f3 |
children | 6d92bbe6c7de |
comparison
equal
deleted
inserted
replaced
8527:bb942fc35ba7 | 8528:630300c7a26c |
---|---|
131 call assert_equal(1, g:found_one) | 131 call assert_equal(1, g:found_one) |
132 colorscheme two | 132 colorscheme two |
133 call assert_equal(1, g:found_two) | 133 call assert_equal(1, g:found_two) |
134 colorscheme three | 134 colorscheme three |
135 call assert_equal(1, g:found_three) | 135 call assert_equal(1, g:found_three) |
136 endfunc | |
137 | |
138 func Test_colorscheme_completion() | |
139 let colordirrun = &packpath . '/runtime/colors' | |
140 let colordirstart = &packpath . '/pack/mine/start/foo/colors' | |
141 let colordiropt = &packpath . '/pack/mine/opt/bar/colors' | |
142 call mkdir(colordirrun, 'p') | |
143 call mkdir(colordirstart, 'p') | |
144 call mkdir(colordiropt, 'p') | |
145 call writefile(['let g:found_one = 1'], colordirrun . '/one.vim') | |
146 call writefile(['let g:found_two = 1'], colordirstart . '/two.vim') | |
147 call writefile(['let g:found_three = 1'], colordiropt . '/three.vim') | |
148 exe 'set rtp=' . &packpath . '/runtime' | |
149 | |
150 let li=[] | |
151 call feedkeys(":colorscheme " . repeat("\<Tab>", 1) . "')\<C-B>call add(li, '\<CR>", 't') | |
152 call feedkeys(":colorscheme " . repeat("\<Tab>", 2) . "')\<C-B>call add(li, '\<CR>", 't') | |
153 call feedkeys(":colorscheme " . repeat("\<Tab>", 3) . "')\<C-B>call add(li, '\<CR>", 't') | |
154 call feedkeys(":colorscheme " . repeat("\<Tab>", 4) . "')\<C-B>call add(li, '\<CR>", 'tx') | |
155 call assert_equal("colorscheme one", li[0]) | |
156 call assert_equal("colorscheme three", li[1]) | |
157 call assert_equal("colorscheme two", li[2]) | |
158 call assert_equal("colorscheme ", li[3]) | |
136 endfunc | 159 endfunc |
137 | 160 |
138 func Test_runtime() | 161 func Test_runtime() |
139 let rundir = &packpath . '/runtime/extra' | 162 let rundir = &packpath . '/runtime/extra' |
140 let startdir = &packpath . '/pack/mine/start/foo/extra' | 163 let startdir = &packpath . '/pack/mine/start/foo/extra' |