comparison src/testdir/test_cmdline.vim @ 26032:162ef12a3b5f v8.2.3550

patch 8.2.3550: completion() does not work properly Commit: https://github.com/vim/vim/commit/ae38a9db7770b38889fbf06908cc69d42b463a73 Author: Shougo Matsushita <Shougo.Matsu@gmail.com> Date: Thu Oct 21 11:39:53 2021 +0100 patch 8.2.3550: completion() does not work properly Problem: completion() does not work properly. Solution: Set xp_line and add WILD_HOME_REPLACE. (Shougo Matsushita, closes #9016)
author Bram Moolenaar <Bram@vim.org>
date Thu, 21 Oct 2021 12:45:04 +0200
parents 94a8f120a06e
children 44fe7d15881d
comparison
equal deleted inserted replaced
26031:1e5e92723674 26032:162ef12a3b5f
303 let l = getcompletion('', 'dir') 303 let l = getcompletion('', 'dir')
304 call assert_true(index(l, 'samples/') >= 0) 304 call assert_true(index(l, 'samples/') >= 0)
305 let l = getcompletion('NoMatch', 'dir') 305 let l = getcompletion('NoMatch', 'dir')
306 call assert_equal([], l) 306 call assert_equal([], l)
307 307
308 if glob('~/*') !=# ''
309 let l = getcompletion('~/', 'dir')
310 call assert_true(l[0][0] ==# '~')
311 endif
312
308 let l = getcompletion('exe', 'expression') 313 let l = getcompletion('exe', 'expression')
309 call assert_true(index(l, 'executable(') >= 0) 314 call assert_true(index(l, 'executable(') >= 0)
310 let l = getcompletion('kill', 'expression') 315 let l = getcompletion('kill', 'expression')
311 call assert_equal([], l) 316 call assert_equal([], l)
312 317
415 call assert_equal([], l) 420 call assert_equal([], l)
416 let l = getcompletion('call tag', 'cmdline') 421 let l = getcompletion('call tag', 'cmdline')
417 call assert_true(index(l, 'taglist(') >= 0) 422 call assert_true(index(l, 'taglist(') >= 0)
418 let l = getcompletion('call paint', 'cmdline') 423 let l = getcompletion('call paint', 'cmdline')
419 call assert_equal([], l) 424 call assert_equal([], l)
425
426 func T(a, c, p)
427 return "oneA\noneB\noneC"
428 endfunc
429 command -nargs=1 -complete=custom,T MyCmd
430 let l = getcompletion('MyCmd ', 'cmdline')
431 call assert_equal(['oneA', 'oneB', 'oneC'], l)
432
433 delcommand MyCmd
434 delfunc T
420 435
421 " For others test if the name is recognized. 436 " For others test if the name is recognized.
422 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user'] 437 let names = ['buffer', 'environment', 'file_in_path', 'mapping', 'tag', 'tag_listfiles', 'user']
423 if has('cmdline_hist') 438 if has('cmdline_hist')
424 call add(names, 'history') 439 call add(names, 'history')