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-core/managers/std/init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lua/mason-core/managers/std/init.lua') diff --git a/lua/mason-core/managers/std/init.lua b/lua/mason-core/managers/std/init.lua index dda39bac..eb7db9bb 100644 --- a/lua/mason-core/managers/std/init.lua +++ b/lua/mason-core/managers/std/init.lua @@ -21,9 +21,7 @@ end function M.ensure_executable(executable, opts) local ctx = installer.context() opts = opts or {} - if vim.in_fast_event() then - a.scheduler() - end + a.scheduler() if vim.fn.executable(executable) ~= 1 then ctx.stdio_sink.stderr(("%s was not found in path.\n"):format(executable)) if opts.help_url then @@ -190,9 +188,7 @@ end ---@params opts function M.select(items, opts) assert(not platform.is_headless, "Tried to prompt for user input while in headless mode.") - if vim.in_fast_event() then - a.scheduler() - end + a.scheduler() local async_select = a.promisify(vim.ui.select) return async_select(items, opts) end -- cgit v1.2.3-70-g09d2