blink.cmp
blink.cmp copied to clipboard
Source defined keyword regex
Feature Description
nvim-cmp allows sources to define their own keyword_regex to match on and control when the source is refetched. Blink's fuzzy matcher uses a scoring system that increases with longer matches, making sorting with different length keywords tricky.
I ran into some unicode issues in the blink-ripgrep plugin. The issue was that lua regex are not capable of matching unicode characters. This will probably not matter for LSP results because most programming languages more or less use ASCII characters, but for human text it can be a useful feature to support.
I worked around this issue in my plugin by using vim.lpeg (lua parsing expression grammar) to parse the prefix instead of regex:
https://github.com/mikavilpas/blink-ripgrep.nvim/blob/40eee5698b3a6ffe8721c67e7481f26249eec888/lua/blink-ripgrep/init.lua#L16-L36
This is a non issue for me currently, but if a deeper integration is needed (e.g. for sorting results), maybe a function could be supported in addition to a regex?
Decided against implementing this