mirror of
https://github.com/kristoferssolo/telescope-frecency.nvim.git
synced 2025-10-21 20:10:38 +00:00
fix: delay calling vim.ui.select to avoid errors (#246)
Fix #243 It occurs an error E5560 when UI to select `y/n` by the user in validating DB. This delays it until the next tick to avoid errors.
This commit is contained in:
parent
9d4d8d21f6
commit
673585ee99
@ -43,7 +43,7 @@ function Frecency:setup()
|
|||||||
init()
|
init()
|
||||||
else
|
else
|
||||||
async.void(init)()
|
async.void(init)()
|
||||||
local ok, status = vim.wait(1000, function()
|
local ok, status = vim.wait(10000, function()
|
||||||
return done
|
return done
|
||||||
end)
|
end)
|
||||||
if not ok then
|
if not ok then
|
||||||
@ -99,6 +99,9 @@ function Frecency:validate_database(force)
|
|||||||
remove_entries()
|
remove_entries()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
-- HACK: This is needed because the default implementaion of vim.ui.select()
|
||||||
|
-- uses vim.fn.* function and it makes E5560 error.
|
||||||
|
async.util.scheduler()
|
||||||
vim.ui.select({ "y", "n" }, {
|
vim.ui.select({ "y", "n" }, {
|
||||||
prompt = self:message("remove %d entries from database?", #unlinked),
|
prompt = self:message("remove %d entries from database?", #unlinked),
|
||||||
---@param item "y"|"n"
|
---@param item "y"|"n"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user