Skip to content

Commit

Permalink
fix: deal with the pattern when score is -1
Browse files Browse the repository at this point in the history
  • Loading branch information
delphinus committed Apr 29, 2024
1 parent 42b6421 commit 5026c5c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/frecency/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ Config.new = function()
---@param fzy_score number
---@return number
scoring_function = function(recency, fzy_score)
return (10 / (recency == 0 and 1 or recency)) - 1 / fzy_score
local score = (10 / (recency == 0 and 1 or recency)) - 1 / fzy_score
-- HACK: -1 means FILTERED, so return a bit smaller one.
return score == -1 and -1.000001 or score
end,
show_filter_column = true,
show_scores = false,
Expand Down

0 comments on commit 5026c5c

Please sign in to comment.