aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-16 06:07:01 +0800
committerGitHub <noreply@github.com>2023-08-16 06:07:01 +0800
commit3cd5ef63fd17a4eb294856360039803f31a10a76 (patch)
tree12fad468cc5026ef6b706a874b3d439ea57390e9 /test
parente72c0cd92090c1fc1e5665a060b3e1d0094d7f30 (diff)
downloadrneovim-3cd5ef63fd17a4eb294856360039803f31a10a76.tar.gz
rneovim-3cd5ef63fd17a4eb294856360039803f31a10a76.tar.bz2
rneovim-3cd5ef63fd17a4eb294856360039803f31a10a76.zip
vim-patch:9.0.1714: getcompletion() "cmdline" fails after :autocmd (#24727)
Problem: getcompletion() "cmdline" fails after :autocmd Solution: Use set_cmd_context() instead of set_one_cmd_context(). closes: vim/vim#12804 https://github.com/vim/vim/commit/e4c79d36150431ffb97cb8952ec482af2e57f228
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_cmdline.vim15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index 506b3d41ff..eaea31f3eb 100644
--- a/test/old/testdir/test_cmdline.vim
+++ b/test/old/testdir/test_cmdline.vim
@@ -601,6 +601,8 @@ func Test_getcompletion()
call assert_true(index(l, 'taglist(') >= 0)
let l = getcompletion('call paint', 'cmdline')
call assert_equal([], l)
+ let l = getcompletion('autocmd BufEnter * map <bu', 'cmdline')
+ call assert_equal(['<buffer>'], l)
func T(a, c, p)
let g:cmdline_compl_params = [a:a, a:c, a:p]
@@ -3636,14 +3638,15 @@ func Test_rulerformat_position()
call StopVimInTerminal(buf)
endfunc
-func Test_usercmd_completion()
- let g:complete=[]
+func Test_getcompletion_usercmd()
command! -nargs=* -complete=command TestCompletion echo <q-args>
- let g:complete = getcompletion('TestCompletion ', 'cmdline')
- let a = getcompletion('', 'cmdline')
- call assert_equal(a, g:complete)
+ call assert_equal(getcompletion('', 'cmdline'),
+ \ getcompletion('TestCompletion ', 'cmdline'))
+ call assert_equal(['<buffer>'],
+ \ getcompletion('TestCompletion map <bu', 'cmdline'))
+
delcom TestCompletion
- unlet! g:complete
endfunc
+
" vim: shiftwidth=2 sts=2 expandtab