Yegappan wrote:

> On Sat, Sep 12, 2020 at 1:09 PM Prabir Shrestha <vim-dev-git...@256bit.org>
> wrote:
> 
> > +1 for adding fuzzy match.
> >
> > A bit late to this. But few questions.
> >
> > How do we use matchfuzzy for a list of dictionary instead of item. Primary
> > reason for this is LSP (language server protocol) makes heavy use of
> > user_data. Can you add an example for sorting a list whose type is dict [
> > { 'word': 'foo', user_data: 1}, { 'word': 'foobar', user_data: 2}, {
> > 'word': 'bar', user_data: 3} ]. Should we have a 3rd optional parameter
> > that takes a callback?
> >
> > let completeitems = [
> >  \ { 'word': 'foo', user_data: 1},
> >  \ { 'word': 'foobar', user_data: 2},
> >  \ { 'word': 'bar', user_data: 3}
> >  \ ]
> > let filtertedlist = matchfuzzy(completeitems, 'foo', {item->item['word']})
> >
> >
> That is a good idea. We can add a callback argument that will be called for
> each item if the list item is dictionary.

That's very slow though.  How about supporting items that are a list with
two (or more) entries, where the first entry is a string, which is used
to sort on?  The second item can then be the user data.

> > Can we also have this support set completeopt+=matchfuzzy?
>
> Extending other existing Vim features to use fuzzy matching is a separate
> activity :-)

-- 
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us.     (Calvin)

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202009122103.08CL3kJj1225113%40masaka.moolenaar.net.

Raspunde prin e-mail lui