Yegappan wrote:

> >> I am attaching a patch to add a function to get the command-line
> >> completion matches.
> >
> > Interesting.  It seems useful, but I can't think of when or where.
> > How would one use this?
> >
> 
> Many Vim plugins need the list of matches produced by the built-in
> Vim completion feature. There are several Vim plugin libraries that
> use different workarounds to get this list today. For example, look
> at the following library that uses different methods to get the list
> of color schemes, syntax items, history entries, etc.
> 
> https://github.com/junegunn/fzf.vim/blob/master/autoload/fzf/vim.vim
> 
> Another Vim library that does similar things is:
> 
> https://github.com/vim-scripts/tlib/tree/master/autoload/tlib
> 
> Another one is the ctrlp plugin:
> 
> https://github.com/ctrlpvim/ctrlp.vim/blob/master/autoload/ctrlp.vim
> 
> These Vim libraries/plugins can use the new function to get the list of
> completion matches in a clean way than the current work arounds.
> 
> Also, the new function will allow custom user command completion
> functions to get the list of standard completion matches and then
> customize them. The new function will extend the power of the
> built-in completion feature to Vim plugins.

OK, I see the use for it.  And it's not much code.

I'll add a simple test.  And remove unused variables.  And fix the
#ifdef.

I don't like the name much: getcmdmatches().  The first line of the help
is:
        Return a list of command-line completion matches.

I think "completion" is the key word here.  Perhaps
getcompletematches()?  That's quite long.  With an empty pattern it's
more a complete list than matches, thus we can leave "matches" out.
I think getcomplete() is better.  Or should it be getcompletion()?
Avoids the double meaning of "complete".

-- 
hundred-and-one symptoms of being an internet addict:
245. You use Real Audio to listen to a radio station from a distant
     city rather than turn on your stereo system.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui