mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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
28a23602e8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user