Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add exact match comparator #1099

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ruslanSorokin
Copy link
Contributor

No description provided.

@ruslanSorokin
Copy link
Contributor Author

Implements #1085

local keyword = line:sub(keyword_start_col, keyword_end_col - 1)
local keyword = line:sub(keyword_start_col, keyword_end_col)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm certain that the keyword is always truncated by one character on the right, but I'm not sure if I'm fixing it in the right place. I would appreciate it if you could take a look at this with your understanding of the code's semantics as its author.

@Saghen
Copy link
Owner

Saghen commented Jan 28, 2025

Thanks for looking into this. We should calculate whether the match is exact during the fuzzy matching, since the keyword range can vary depending on the item, so this change isn't trivial: https://github.com/Saghen/blink.cmp/blob/main/lua/blink/cmp/fuzzy/fuzzy.rs#L79

I believe we should add an exact property on the matched item in frizbee, since it's already calculated there. We currently give a score bonus of 4 in this case, so this issue seems to only appear when users change their score_offset: https://github.com/Saghen/frizbee/blob/main/src/simd.rs#L247. We would need to make sure this doesn't affect performance as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants