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)
18 lines
486 B
Lua
18 lines
486 B
Lua
local uv = vim.uv or vim.loop
|
|
local Path = require "plenary.path"
|
|
|
|
---@param entries string[]
|
|
---@return PlenaryPath the top dir of tree
|
|
---@return fun(): nil sweep all entries
|
|
local function make_tree(entries)
|
|
local dir = Path:new(Path.new(assert(uv.fs_mkdtemp "tests_XXXXXX")):absolute())
|
|
for _, entry in ipairs(entries) do
|
|
dir:joinpath(entry):touch { parents = true }
|
|
end
|
|
return dir, function()
|
|
dir:rm { recursive = true }
|
|
end
|
|
end
|
|
|
|
return { make_tree = make_tree }
|