Skip to content

Commit

Permalink
speedup
Browse files Browse the repository at this point in the history
  • Loading branch information
jayli committed Jan 17, 2024
1 parent 4de38be commit dcad32a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/easycomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,16 @@ function EasyComplete.filter(match_list, needle)
for _, item in ipairs(match_list) do
if #item < #needle then
-- pass
goto continue
elseif item == needle then
-- pass
elseif string.find(string.lower(item), "^" .. string.lower(needle)) ~= nil then
goto continue
end
local idx = string.find(string.lower(item), "" .. string.lower(needle))
if type(idx) == type(2) and idx <= 3 then
table.insert(result, item)
end
::continue::
end
return result
end
Expand Down

0 comments on commit dcad32a

Please sign in to comment.