aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-06-19 05:47:25 +0800
committerGitHub <noreply@github.com>2024-06-19 05:47:25 +0800
commit4e8ec4900eb9fdc2a864e65d3de73c51e963abd0 (patch)
tree7ea5d55dbb2da2113967c2df823fb49c6ec9f15e /test
parentb0c336eaf8e7dd0e52e08195f46fd309fc138ea1 (diff)
downloadrneovim-4e8ec4900eb9fdc2a864e65d3de73c51e963abd0.tar.gz
rneovim-4e8ec4900eb9fdc2a864e65d3de73c51e963abd0.tar.bz2
rneovim-4e8ec4900eb9fdc2a864e65d3de73c51e963abd0.zip
vim-patch:9.1.0498: getcmdcompltype() interferes with cmdline completion (#29397)
Problem: getcmdcompltype() interferes with cmdline completion. Solution: Don't set expand context when it's already set. (zeertzjq) closes: vim/vim#15036 https://github.com/vim/vim/commit/a821b609f9bb9daef032fe1cb8fb95995822e367
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_cmdline.vim15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index 4a637552a6..24811d49db 100644
--- a/test/old/testdir/test_cmdline.vim
+++ b/test/old/testdir/test_cmdline.vim
@@ -3785,7 +3785,7 @@ func Test_cmdline_complete_bang_cmd_argument()
endfunc
func Call_cmd_funcs()
- return string([getcmdpos(), getcmdscreenpos(), getcmdcompltype()])
+ return [getcmdpos(), getcmdscreenpos(), getcmdcompltype()]
endfunc
func Test_screenpos_and_completion()
@@ -3793,13 +3793,24 @@ func Test_screenpos_and_completion()
call assert_equal(0, getcmdscreenpos())
call assert_equal('', getcmdcompltype())
- cnoremap <expr> <F2> string([getcmdpos(), getcmdscreenpos(), getcmdcompltype()])
+ cnoremap <expr> <F2> string(Call_cmd_funcs())
call feedkeys(":let a\<F2>\<C-B>\"\<CR>", "xt")
call assert_equal("\"let a[6, 7, 'var']", @:)
call feedkeys(":quit \<F2>\<C-B>\"\<CR>", "xt")
call assert_equal("\"quit [6, 7, '']", @:)
call feedkeys(":nosuchcommand \<F2>\<C-B>\"\<CR>", "xt")
call assert_equal("\"nosuchcommand [15, 16, '']", @:)
+
+ " Check that getcmdcompltype() doesn't interfere with cmdline completion.
+ let g:results = []
+ cnoremap <F2> <Cmd>let g:results += [[getcmdline()] + Call_cmd_funcs()]<CR>
+ call feedkeys(":sign un\<Tab>\<F2>\<Tab>\<F2>\<Tab>\<F2>\<C-C>", "xt")
+ call assert_equal([
+ \ ['sign undefine', 14, 15, 'sign'],
+ \ ['sign unplace', 13, 14, 'sign'],
+ \ ['sign un', 8, 9, 'sign']], g:results)
+
+ unlet g:results
cunmap <F2>
endfunc