From 82ba05c7845941e7f5a39f4b6d96072dfb04a421 Mon Sep 17 00:00:00 2001 From: Dan Salvato Date: Sun, 10 Dec 2023 03:57:59 -0700 Subject: [PATCH] Fix fuzzy matcher adding invalid matches (#909) (#1420) --- lua/cmp/matcher.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/matcher.lua b/lua/cmp/matcher.lua index 26b3d1f..48bf96a 100644 --- a/lua/cmp/matcher.lua +++ b/lua/cmp/matcher.lua @@ -257,7 +257,7 @@ matcher.fuzzy = function(input, word, matches, option) word_offset = word_offset + 1 end - if input_index > #input then + if matched and input_index > #input then table.insert(matches, { input_match_start = input_match_start, input_match_end = input_match_end,