Hi,

On Sat, Sep 12, 2020 at 1:42 PM Yegappan Lakshmanan <[email protected]>
wrote:

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

You can try the attached diff which implements the above and see how this
works with a
very large list of dictionaries.

- Yegappan


>
>
>> Can we also have this support set completeopt+=matchfuzzy?
>>
>>
>>
>

-- 
-- 
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/CAAW7x7nW%3DKuzpvdXOMiyOajKF9smXS%2BERJBL-A6CEiQNKzLWZA%40mail.gmail.com.

Attachment: fuzzy.diff
Description: Binary data

Raspunde prin e-mail lui