From 55515ae401632d5d19fcc86f8b19e1a883a66005 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 8d19174..4abbdc4 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 ------------------------------------------