diff options
| author | William Boman <william@redwill.se> | 2025-02-15 21:00:35 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-15 21:00:35 +0100 |
| commit | 3a444cb7b0cee6b1e2ed31b7e76f37509075dc46 (patch) | |
| tree | 4cfc848de225c78f0b9ff63a64902203b9c043b7 /lua/mason-core/platform.lua | |
| parent | fix(ui): reposition window if border is different than "none" (#1859) (diff) | |
| download | mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.tar mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.tar.gz mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.tar.bz2 mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.tar.lz mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.tar.xz mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.tar.zst mason-3a444cb7b0cee6b1e2ed31b7e76f37509075dc46.zip | |
fix: avoid calling vim.fn in fast event (#1878)
Diffstat (limited to 'lua/mason-core/platform.lua')
| -rw-r--r-- | lua/mason-core/platform.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lua/mason-core/platform.lua b/lua/mason-core/platform.lua index cd958abc..1fe20e5e 100644 --- a/lua/mason-core/platform.lua +++ b/lua/mason-core/platform.lua @@ -66,7 +66,7 @@ end) -- Most of the code that calls into these functions executes outside of the main event loop, where API/fn functions are -- disabled. We evaluate these immediately here to avoid issues with main loop synchronization. -local cached_features = { +M.cached_features = { ["win"] = vim.fn.has "win32", ["win32"] = vim.fn.has "win32", ["win64"] = vim.fn.has "win64", @@ -74,6 +74,7 @@ local cached_features = { ["darwin"] = vim.fn.has "mac", ["unix"] = vim.fn.has "unix", ["linux"] = vim.fn.has "linux", + ["nvim-0.11"] = vim.fn.has "nvim-0.11", } ---@type fun(env: string): boolean @@ -104,7 +105,7 @@ local check_env = _.memoize(_.cond { M.is = setmetatable({}, { __index = function(__, key) local os, arch, env = unpack(vim.split(key, "_", { plain = true })) - if not cached_features[os] or cached_features[os] ~= 1 then + if not M.cached_features[os] or M.cached_features[os] ~= 1 then return false end if arch and arch ~= M.arch then |
