From eef10aecb9ec0bda885294a0fa4ac9dffda76106 Mon Sep 17 00:00:00 2001 From: Isard Botha Date: Thu, 11 Jul 2024 00:15:02 +0100 Subject: [PATCH] fix: Make command execution on windows work for non-exe open methods This should make is so that using "start" as an open_program in the config actually works on windows. it changes the executable check out for an try-catch basically. --- lua/crates/util.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/crates/util.lua b/lua/crates/util.lua index e4228f0..f9133e7 100644 --- a/lua/crates/util.lua +++ b/lua/crates/util.lua @@ -215,8 +215,8 @@ end ---@param url string function M.open_url(url) for _, prg in ipairs(state.cfg.open_programs) do - if M.binary_installed(prg) then - vim.cmd(string.format("silent !%s %s", prg, url)) + local ok, result = pcall(vim.cmd, string.format("silent !%s %s", prg, url)) + if ok == true then return end end