summaryrefslogtreecommitdiff
path: root/lua/telescope/sorters.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/sorters.lua')
-rw-r--r--lua/telescope/sorters.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/lua/telescope/sorters.lua b/lua/telescope/sorters.lua
index e2a7639..474bdff 100644
--- a/lua/telescope/sorters.lua
+++ b/lua/telescope/sorters.lua
@@ -26,7 +26,7 @@ end
function Sorter:score(prompt, entry)
-- TODO: Decide if we actually want to check the type every time.
- return self:scoring_function(prompt, type(entry) == "string" and entry or entry.ordinal)
+ return self:scoring_function(prompt, type(entry) == "string" and entry or entry.ordinal, entry)
end
function sorters.new(...)
@@ -232,7 +232,11 @@ sorters.get_norcalli_sorter = function()
end
return Sorter:new {
- scoring_function = function(_, prompt, line)
+ -- self
+ -- prompt (which is the text on the line)
+ -- line (entry.ordinal)
+ -- entry (the whole entry)
+ scoring_function = function(_, prompt, line, _)
if prompt == 0 or #prompt < ngramlen then
return 0
end