fix: Better approach to check if the system is Windows before setting PATH (#2690)

* Better approach to check if the system is Windows

Now the check for Windows doesn't depend on luv's os_uname() function, which may have a different result if neovim was built on different compilers (MSVC, MinGW, etc).

* remove un-needed parenthesis

---------

Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>
This commit is contained in:
Pablo Rodriguez 2024-03-10 10:33:32 -04:00 committed by Tim Blume
parent cd2dddfc4b
commit 55515ae401

View file

@ -57,7 +57,7 @@ for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
end end
-- add binaries installed by mason.nvim to path -- add binaries installed by mason.nvim to path
local is_windows = vim.loop.os_uname().sysname == "Windows_NT" local is_windows = vim.fn.has("win32") ~= 0
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
-------------------------------------- autocmds ------------------------------------------ -------------------------------------- autocmds ------------------------------------------