Xavier de Gaye wrote:

> With vim 7.1, enter the following statements on the command line:
> 
>     :let l = ['toto', 'tutu']
>     :function Completion(A, L, P)
>     :   return g:l
>     :endfunction
>     :command! -nargs=* -complete=customlist,Completion Test echo "Done"
> 
> The completion on 'tutu' is not right.
> Typing:
> 
>     :Test tu<Tab>
> 
> gives:
> 
>     :Test toto
> 
> instead of:
> 
>     :Test tutu
> 
> The same test using custom completion and a string instead of a
> list, works fine.

>From the help:

The function may use these for determining context.  For the "custom"
argument, it is not necessary to filter candidates against the (implicit
pattern in) ArgLead.  Vim will do filter the candidates with its regexp engine
after function return, and this is probably more efficient in most cases. For
the "customlist" argument, Vim will not filter the returned completion
candidates and the user supplied function should filter the candidates.

Thus it works as intended.

-- 
>From "know your smileys":
 :-E    Has major dental problems

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui