When want to make command line completion, we use -complete=customlist,XXX. But it can't work with candidates contain spaces. For example, it can't treat 'C:\Program Files'.
function! CompleteFunc(A, L, P) echomsg string([a:A, a:L, a:P]) return map(split(glob(a:A . '*'), "\n"), 'fnameescape(v:val)') endfunction command! -nargs=* -complete=customlist,CompleteFunc Test : Below is a patch. https://gist.github.com/3089589 Please check. However, I wonder why ExpandEscape() choose kind of context to escape. if (xp->xp_context == EXPAND_FILES || xp->xp_context == EXPAND_FILES_IN_PATH || xp->xp_context == EXPAND_SHELLCMD || xp->xp_context == EXPAND_BUFFERS || xp->xp_context == EXPAND_DIRECTORIES) Currently, vim script like above should escape candidates. But I'm thinking escaping should work always for command line completion. -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
