From 1a98a451ea6a88a96ce24c3b78b0eeb875b05dbd Mon Sep 17 00:00:00 2001 From: Pablo Rodriguez <107005300+pablojrl123@users.noreply.github.com> Date: Sun, 10 Mar 2024 10:33:32 -0400 Subject: [PATCH] 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 --- lua/core/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/core/init.lua b/lua/core/init.lua index 9555ba5..466643a 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -57,7 +57,7 @@ for _, provider in ipairs { "node", "perl", "python3", "ruby" } do end -- 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 -------------------------------------- autocmds ------------------------------------------