aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/managers/std/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-04-03 00:33:48 +0200
committerGitHub <noreply@github.com>2023-04-02 22:33:48 +0000
commit0114336145771ff7c528debba52c5ff21bf6f7a2 (patch)
tree37802cb27b602c9c3e900aec7f3ad012ed3b8719 /lua/mason-core/managers/std/init.lua
parentchore: consolidate generate task (#1171) (diff)
downloadmason-0114336145771ff7c528debba52c5ff21bf6f7a2.tar
mason-0114336145771ff7c528debba52c5ff21bf6f7a2.tar.gz
mason-0114336145771ff7c528debba52c5ff21bf6f7a2.tar.bz2
mason-0114336145771ff7c528debba52c5ff21bf6f7a2.tar.lz
mason-0114336145771ff7c528debba52c5ff21bf6f7a2.tar.xz
mason-0114336145771ff7c528debba52c5ff21bf6f7a2.tar.zst
mason-0114336145771ff7c528debba52c5ff21bf6f7a2.zip
refactor: only schedule in a.scheduler() when in fast event (#1170)
Explicitly schedule via `a.wait(vim.schedule)` instead.
Diffstat (limited to 'lua/mason-core/managers/std/init.lua')
-rw-r--r--lua/mason-core/managers/std/init.lua8
1 files changed, 2 insertions, 6 deletions
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