On Do, 15 Okt 2020, Yegappan Lakshmanan wrote:
> Hi Bram, > > On Thu, Oct 15, 2020 at 12:24 PM Bram Moolenaar <[email protected]> wrote: > > > Christian wrote: > > > Indeed. Initially I thought adding a bonus for a word boundary would be > > needed, therefore my naive attempt to score additionally on the end of > > the match. So how about this, which adds an additional bonus only for a > > complete match. > > > > An extra score for a whole match makes a big jump. It might work better > when giving a match a bit of extra score if the previous character also > matched. Thus the more consequtive characters match the better. This > seems to make sense: matches spread out over a line of text score lower > than when some matches group together. And reach the maximum when they > are all together. > > > > The current implementation already supports this. Each sequential matching > character is given a bonus score (SEQUENTIAL_BONUS). > > A matching character after an underscore or space is given a bonus > score (SEPARATOR_BONUS). Because of this a string with a matching > letter after an underscore is given precedence over a fully matched sequence > of characters. Yes currently, SEQUENTIAL_BONUS is 15, while SEPARATOR_BONUS is 30. This makes `v_i_m_r_c` be the preferred match against e.g. vimrc. So I think SEQUENTIAL_BONUS should probably score higher than SEPARATOR_BONUS. I think this might be a better way to continue here. I'll make a PR for that. On a related note, I wonder whether SEPARATOR_BONUS should also be added for path delimiters (`/` on unix `\` on windows). Best, Christian -- Der schlimmste aller Fehler ist, sich keines solchen bewußt zu sein. -- Thomas Carlyle -- -- 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/20201016061420.GM1656%40256bit.org.
