Hi Bram, On Sat, Jul 9, 2016 at 9:50 AM, Bram Moolenaar <[email protected]> wrote: > > 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. >
Thanks for incorporating the patch. > > I don't like the name much: getcmdmatches(). > I was not sure what to call the function. > > 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". > The getcompletion() function name sounds good to me. Regards, Yegappan -- -- 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.
