Hi,

On Tue, Sep 15, 2020 at 10:50 AM Prabir Shrestha <[email protected]>
wrote:

> *@prabirshrestha* requested changes on this pull request.
>
> added few comments.
> ------------------------------
>
> In src/testdir/test_functions.vim
> <https://github.com/vim/vim/pull/6947#discussion_r488855126>:
>
> > +  call assert_fails("let x = matchfuzzy(l, 'day', {'text_cb' : {a, b -> 
> > 1}})", 'E119:')
> +  call assert_equal([], matchfuzzy(l, 'cam'))
> +  call assert_fails("let x = matchfuzzy(l, 'cam', {'text_cb' : []})", 
> 'E921:')
> +  call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : []})", 'E730:')
> +  call assert_fails("let x = matchfuzzy(l, 'cam', test_null_dict())", 
> 'E715:')
> +  call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : 
> test_null_string()})", 'E475:')
> +  call assert_fails("let x = matchfuzzy(l, 'foo', {'text_cb' : 
> test_null_function()})", 'E475:')
> +
> +  let l = [{'id' : 5, 'name' : 'foo'}, {'id' : 6, 'name' : []}, {'id' : 7}]
> +  call assert_fails("let x = matchfuzzy(l, 'foo', {'key' : 'name'})", 
> 'E730:')
> +endfunc
> +
> +" Test for the fuzzymatchpos() function
> +func Test_matchfuzzypos()
> +  call assert_equal([['curl', 'world'], [[2,3], [2,3]]], 
> matchfuzzypos(['world', 'curl'], 'rl'))
> +  call assert_equal([['curl', 'world'], [[2,3], [2,3]]], 
> matchfuzzypos(['world', 'one', 'curl'], 'rl'))
>
> shouldn't this response be this instead? so that if there is multiple
> highlights it can still be represented correctly?
>
> [
>    [ "curl", "world", "curl world"],
>    [
>        [ [2,3] ],
>        [ [2,3 ] ],
>        [  [2,3], [7,8] ]
>    ]
> ]
>
>
> The fuzzy matching currently looks for only the first match. If there are
multiple matches in the same
string, it currently returns only the first match.

- 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/CAAW7x7mNBhvfMOFV1stHMN7b0gnHuHDa1qGoGDTmhRm4gUkyVA%40mail.gmail.com.

Raspunde prin e-mail lui