Skip to content

Commit

Permalink
fix: Make command execution on windows work for non-exe open methods (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ibotha authored Aug 2, 2024
1 parent 82c7a93 commit 1c924d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/crates/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,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
Expand Down

0 comments on commit 1c924d5

Please sign in to comment.