Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit 8c63501

Browse files
committed
fix: error on path completion(#131)
1 parent 994450a commit 8c63501

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/completion/source/path.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ local M = {}
22
local vim = vim
33
local loop = vim.loop
44
local api = vim.api
5+
local util = require 'completion.util'
56

67
M.items = {}
78
M.callback = false
@@ -33,10 +34,10 @@ local fileTypesMap = setmetatable({
3334
end
3435
})
3536

36-
M.getCompletionItems = function(prefix, score_func)
37+
M.getCompletionItems = function(prefix)
3738
local complete_items = {}
3839
for _, val in ipairs(M.items) do
39-
local score = score_func(prefix, val.name)
40+
local score = util.fuzzy_score(prefix, val.name)
4041
if score < #prefix/3 or #prefix == 0 then
4142
table.insert(complete_items, {
4243
word = val.name,

0 commit comments

Comments
 (0)