diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-09-29 19:58:35 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-29 19:58:35 +0200 |
commit | 28a23602e8f88937645b8506b7915ecea6e09b18 (patch) | |
tree | 83677a9ee654a632ae39646e12f8adc9d91d6a24 /src/testdir/test_cmdline.vim | |
parent | ee865f37acab6cac2cee6a171d60e1b365f852b0 (diff) |
patch 9.0.1956: Custom completion skips orig cmdline if it invokes glob()v9.0.1956
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: #13216
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/testdir/test_cmdline.vim')
-rw-r--r-- | src/testdir/test_cmdline.vim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index b2566cdfb1..a54c507387 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -3549,4 +3549,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 |