mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
* I did an overhall for all codes and added typing by Lua-language-server and tests. It also works on CI. * Now it searches files on the workspace completely asynchronously. It does not block your text input. (Fix #106) Make count = 1 when you open a file you've never opened (Fix #107)
30 lines
614 B
Lua
30 lines
614 B
Lua
---@type Frecency?
|
|
local frecency
|
|
|
|
return {
|
|
---@param opts FrecencyConfig?
|
|
setup = function(opts)
|
|
frecency = require("frecency.frecency").new(opts)
|
|
frecency:setup()
|
|
end,
|
|
---@param opts FrecencyPickerOptions
|
|
start = function(opts)
|
|
if frecency then
|
|
frecency:start(opts)
|
|
end
|
|
end,
|
|
---@param findstart 1|0
|
|
---@param base string
|
|
---@return integer|''|string[]
|
|
complete = function(findstart, base)
|
|
if frecency then
|
|
return frecency:complete(findstart, base)
|
|
end
|
|
return ""
|
|
end,
|
|
---@return Frecency
|
|
frecency = function()
|
|
return assert(frecency)
|
|
end,
|
|
}
|