mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
parent
ee2af42d5f
commit
9d4d8d21f6
@ -118,15 +118,17 @@ end
|
|||||||
function Database:unlinked_entries()
|
function Database:unlinked_entries()
|
||||||
-- HACK: async.util.join() does not work with empty table. So when the table
|
-- HACK: async.util.join() does not work with empty table. So when the table
|
||||||
-- has no entries, return early.
|
-- has no entries, return early.
|
||||||
local async_fns = vim.tbl_map(function(path)
|
-- TODO: This is fixed in https://github.com/nvim-lua/plenary.nvim/pull/616
|
||||||
return function()
|
local paths = vim.tbl_keys(self.tbl.records)
|
||||||
local err, realpath = async.uv.fs_realpath(path)
|
return #paths == 0 and {}
|
||||||
if err or not realpath or realpath ~= path or fs.is_ignored(realpath) then
|
or vim.tbl_flatten(async.util.join(vim.tbl_map(function(path)
|
||||||
return path
|
return function()
|
||||||
|
local err, realpath = async.uv.fs_realpath(path)
|
||||||
|
if err or not realpath or realpath ~= path or fs.is_ignored(realpath) then
|
||||||
|
return path
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end, paths)))
|
||||||
end, vim.tbl_keys(self.tbl.records))
|
|
||||||
return #async_fns > 0 and vim.tbl_flatten(async.util.join(async_fns)) or {}
|
|
||||||
end
|
end
|
||||||
|
|
||||||
---@async
|
---@async
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user