fix: delay setup not to avoid bg color detection (#213)

Fix #210
This commit is contained in:
JINNOUCHI Yasushi 2024-07-13 23:21:01 +09:00 committed by GitHub
parent 631bf1af1d
commit 880e89eadb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,10 +28,14 @@ end
---This is called when `:Telescope frecency` is called at the first time. ---This is called when `:Telescope frecency` is called at the first time.
---@return nil ---@return nil
function Frecency:setup() function Frecency:setup()
-- HACK: Wihout this wrapping, it spoils background color detection.
-- See https://github.com/nvim-telescope/telescope-frecency.nvim/issues/210
vim.defer_fn(function()
self:assert_db_entries() self:assert_db_entries()
if config.auto_validate then if config.auto_validate then
self:validate_database() self:validate_database()
end end
end, 0)
end end
---This can be calledBy `require("telescope").extensions.frecency.frecency`. ---This can be calledBy `require("telescope").extensions.frecency.frecency`.