diff --git a/README.md b/README.md index a94bd49..5f4d40c 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,9 @@ See [default configuration](https://github.com/nvim-telescope/telescope.nvim#tel ---@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, ``` diff --git a/lua/frecency/config.lua b/lua/frecency/config.lua index eb2d3f4..d72ba81 100644 --- a/lua/frecency/config.lua +++ b/lua/frecency/config.lua @@ -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,