Hi,

On Sat, Sep 12, 2020 at 1:09 PM Prabir Shrestha <[email protected]>
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.


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

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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7mfuAs8PBE3L_Ku8dkPFMowAAj4a0HNXvRfzQ%2BTGvytHQ%40mail.gmail.com.

Raspunde prin e-mail lui