Skip to content

Commit 3cb084c

Browse files
committed
fix: single char non-matching keyword
closes #141
1 parent 57abdb8 commit 3cb084c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/blink/cmp/fuzzy/init.lua

+5
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ function fuzzy.get_query()
8383
cmp_config.keyword_regex,
8484
cmp_config.exclude_from_prefix_regex
8585
)
86+
-- Since sub(1, 1) returns a single char string, we need to check if that single char matches
87+
-- and otherwise return an empty string
88+
if range[1] == range[2] and line:sub(range[1] + 1, range[1] + 1):match(cmp_config.keyword_regex) == nil then
89+
return ''
90+
end
8691
return string.sub(line, range[1] + 1, range[2] + 1)
8792
end
8893

0 commit comments

Comments
 (0)