Renamed commandbar scoring function to be more generic (#31).
This commit is contained in:
@@ -282,7 +282,7 @@ local function score(p, v)
|
||||
return cache[key]
|
||||
end
|
||||
|
||||
function CommandBarScoreFiles(t, pattern, limit)
|
||||
function CommandBarScoreItems(t, pattern, limit)
|
||||
local r, plen = {}, #pattern
|
||||
local maxp = 0
|
||||
local num = 0
|
||||
|
||||
@@ -217,7 +217,7 @@ local function navigateTo(default)
|
||||
end
|
||||
end
|
||||
local topscore
|
||||
for _, item in ipairs(CommandBarScoreFiles(projectFiles, text, 100)) do
|
||||
for _, item in ipairs(CommandBarScoreItems(projectFiles, text, 100)) do
|
||||
local file, score = unpack(item)
|
||||
topscore = topscore or score
|
||||
if score > topscore / 4 and score > 1 then
|
||||
|
||||
Reference in New Issue
Block a user