mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 15:08:35 +00:00
vim-patch:9.0.1956: Custom completion skips orig cmdline if it invokes glob()
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:
@@ -3650,4 +3650,22 @@ func Test_getcompletion_usercmd()
|
||||
delcom TestCompletion
|
||||
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')
|
||||
call writefile([], 'Xglob2')
|
||||
|
||||
call feedkeys(":TestGlobComplete \<Tab> \<Tab>\<C-N> \<Tab>\<C-P>;\<C-B>\"\<CR>", 'xt')
|
||||
call assert_equal('"TestGlobComplete Xglob1 Xglob2 ;', @:)
|
||||
|
||||
call delete('Xglob1')
|
||||
call delete('Xglob2')
|
||||
delcommand TestGlobComplete
|
||||
delfunc TestGlobComplete
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user