Mercurial > vim
comparison src/testdir/test_cmdline.vim @ 13998:c3f9c37160e7 v8.1.0017
patch 8.1.0017: shell command completion has duplicates
commit https://github.com/vim/vim/commit/62fe66f251263715968442e237742d9d3dfd5fa1
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 22 16:58:47 2018 +0200
patch 8.1.0017: shell command completion has duplicates
Problem: Shell command completion has duplicates. (Yegappan Lakshmanan)
Solution: Use a hash table to avoid duplicates. (Ozaki Kiichi, closes https://github.com/vim/vim/issues/539,
closes #2733)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 22 May 2018 17:00:06 +0200 |
parents | 3aac8d62351c |
children | ee649db58c41 |
comparison
equal
deleted
inserted
replaced
13997:4400705e825a | 13998:c3f9c37160e7 |
---|---|
229 let l = getcompletion('', 'mapclear') | 229 let l = getcompletion('', 'mapclear') |
230 call assert_true(index(l, '<buffer>') >= 0) | 230 call assert_true(index(l, '<buffer>') >= 0) |
231 let l = getcompletion('not', 'mapclear') | 231 let l = getcompletion('not', 'mapclear') |
232 call assert_equal([], l) | 232 call assert_equal([], l) |
233 | 233 |
234 let l = getcompletion('.', 'shellcmd') | |
235 call assert_equal(['./', '../'], l[0:1]) | |
236 call assert_equal(-1, match(l[2:], '^\.\.\?/$')) | |
237 let root = has('win32') ? 'C:\\' : '/' | |
238 let l = getcompletion(root, 'shellcmd') | |
239 let expected = map(filter(glob(root . '*', 0, 1), | |
240 \ 'isdirectory(v:val) || executable(v:val)'), 'isdirectory(v:val) ? v:val . ''/'' : v:val') | |
241 call assert_equal(expected, l) | |
242 | |
234 if has('cscope') | 243 if has('cscope') |
235 let l = getcompletion('', 'cscope') | 244 let l = getcompletion('', 'cscope') |
236 let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show'] | 245 let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show'] |
237 call assert_equal(cmds, l) | 246 call assert_equal(cmds, l) |
238 " using cmdline completion must not change the result | 247 " using cmdline completion must not change the result |
256 let l = getcompletion('list ', 'sign') | 265 let l = getcompletion('list ', 'sign') |
257 call assert_equal(['Testing'], l) | 266 call assert_equal(['Testing'], l) |
258 endif | 267 endif |
259 | 268 |
260 " For others test if the name is recognized. | 269 " For others test if the name is recognized. |
261 let names = ['buffer', 'environment', 'file_in_path', | 270 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user'] |
262 \ 'mapping', 'shellcmd', 'tag', 'tag_listfiles', 'user'] | |
263 if has('cmdline_hist') | 271 if has('cmdline_hist') |
264 call add(names, 'history') | 272 call add(names, 'history') |
265 endif | 273 endif |
266 if has('gettext') | 274 if has('gettext') |
267 call add(names, 'locale') | 275 call add(names, 'locale') |