From 0114336145771ff7c528debba52c5ff21bf6f7a2 Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 3 Apr 2023 00:33:48 +0200 Subject: refactor: only schedule in a.scheduler() when in fast event (#1170) Explicitly schedule via `a.wait(vim.schedule)` instead. --- lua/mason-registry/init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lua/mason-registry/init.lua') diff --git a/lua/mason-registry/init.lua b/lua/mason-registry/init.lua index 93472ef3..0f1805a4 100644 --- a/lua/mason-registry/init.lua +++ b/lua/mason-registry/init.lua @@ -176,15 +176,11 @@ function M.refresh(cb) ---@async local function refresh() - if vim.in_fast_event() then - a.scheduler() - end + a.scheduler() local is_outdated = get_store_age(os.time()) > REGISTRY_STORE_TTL if is_outdated or not sources.is_installed() then if a.wait(M.update) then - if vim.in_fast_event() then - a.scheduler() - end + a.scheduler() update_store_timestamp(os.time()) end end -- cgit v1.2.3-70-g09d2