Hi,

On Thu, Nov 5, 2020 at 12:13 PM Maxim Kim <[email protected]> wrote:

> Hi, looks like text matched in the beginning has lower score than a
> shorter line with text not in the beginning:
>
> https://i.imgur.com/CuBkw0S.gif
>
> min repro:
>
> echo ['hello world with a longer line', 'onceHello']->matchfuzzy('hello')
>
> result:
>
> ['onceHello', 'hello world with a longer line']
>
> I personally would expect that 'hello world with a longer line' would be
> scored higher.
>
>
>
The match at the beginning of a string does get a bonus score (15).
But the score is reduced by each unmatched letter in the string.
In the case of the long string in the above example, the number
of unmatched letters (25) is greater than the bonus for the match
at the start of the string (15). So the score for "onceHello" is higher
than for the long string.

- 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/CAAW7x7kdd58QUkP4zjUyP35CTgSL-G%3D%2BUboxM%3D-dOnj_KWtieQ%40mail.gmail.com.

Raspunde prin e-mail lui