fix: deal with the pattern when score is -1 (#193)

* fix: deal with the pattern when score is -1

* docs: fix the default value in README
This commit is contained in:
JINNOUCHI Yasushi 2024-04-29 12:53:44 +09:00 committed by GitHub
parent 42b6421061
commit 62534e2479
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -275,7 +275,9 @@ See [default configuration](https://github.com/nvim-telescope/telescope.nvim#tel
---@param fzy_score number ---@param fzy_score number
---@return number ---@return number
scoring_function = function(recency, fzy_score) 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, end,
``` ```

View File

@ -51,7 +51,9 @@ Config.new = function()
---@param fzy_score number ---@param fzy_score number
---@return number ---@return number
scoring_function = function(recency, fzy_score) 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, end,
show_filter_column = true, show_filter_column = true,
show_scores = false, show_scores = false,