summaryrefslogtreecommitdiff
path: root/lua/telescope/sorters.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-04 09:49:10 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-04 09:49:10 -0400
commit14310ee6b1f40425ba854d6ddc6374960fdf81ca (patch)
treec6ea9c7a2acb62f853e91b4d1544b899a8af9f3e /lua/telescope/sorters.lua
parent996f69465ed51856aa18093d88795fae2b8565f4 (diff)
fix: Don't push past midnight. You'll make clason's stuff break :/
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