Skip to content

Commit 1c924d5

Browse files
authored
fix: Make command execution on windows work for non-exe open methods (#141)
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.
1 parent 82c7a93 commit 1c924d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/crates/util.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ end
234234
---@param url string
235235
function M.open_url(url)
236236
for _, prg in ipairs(state.cfg.open_programs) do
237-
if M.binary_installed(prg) then
238-
vim.cmd(string.format("silent !%s %s", prg, url))
237+
local ok, result = pcall(vim.cmd, string.format("silent !%s %s", prg, url))
238+
if ok == true then
239239
return
240240
end
241241
end

0 commit comments

Comments
 (0)