aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-30 06:30:10 +0800
committerGitHub <noreply@github.com>2023-09-30 06:30:10 +0800
commitdbfdb52ea867ccd900575bd7dd52a71add7a7346 (patch)
tree3721bdb1fa1e07a5aca095752a681a1e4b937faa /test
parentbe463e7643fb65c49a9a13bd5a1c6fb6ac34ae77 (diff)
downloadrneovim-dbfdb52ea867ccd900575bd7dd52a71add7a7346.tar.gz
rneovim-dbfdb52ea867ccd900575bd7dd52a71add7a7346.tar.bz2
rneovim-dbfdb52ea867ccd900575bd7dd52a71add7a7346.zip
vim-patch:9.0.1956: Custom completion skips orig cmdline if it invokes glob() (#25427)
Problem: Custom cmdline completion skips original cmdline when pressing Ctrl-P at first match if completion function invokes glob(). Solution: Move orig_save into struct expand_T. closes: vim/vim#13216 https://github.com/vim/vim/commit/28a23602e8f88937645b8506b7915ecea6e09b18
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_cmdline.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/old/testdir/test_cmdline.vim b/test/old/testdir/test_cmdline.vim
index a85c8229af..54f5dd500b 100644
--- a/test/old/testdir/test_cmdline.vim
+++ b/test/old/testdir/test_cmdline.vim
@@ -3702,4 +3702,20 @@ func Test_custom_completion()
delfunc Check_customlist_completion
endfunc
+func Test_custom_completion_with_glob()
+ func TestGlobComplete(A, L, P)
+ return split(glob('Xglob*'), "\n")
+ endfunc
+
+ command -nargs=* -complete=customlist,TestGlobComplete TestGlobComplete :
+ call writefile([], 'Xglob1', 'D')
+ call writefile([], 'Xglob2', 'D')
+
+ call feedkeys(":TestGlobComplete \<Tab> \<Tab>\<C-N> \<Tab>\<C-P>;\<C-B>\"\<CR>", 'xt')
+ call assert_equal('"TestGlobComplete Xglob1 Xglob2 ;', @:)
+
+ delcommand TestGlobComplete
+ delfunc TestGlobComplete
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab