Skip to content

Commit 9d241e5

Browse files
committed
fix(system-open): use notify for system-open failures and tidy messages
1 parent cf90837 commit 9d241e5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/nvim-tree/actions/node/system-open.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local notify = require "nvim-tree.notify"
2+
13
local M = {
24
config = {
35
is_windows = vim.fn.has "win32" == 1 or vim.fn.has "win32unix" == 1,
@@ -27,14 +29,13 @@ function M.fn(node)
2729
process.stderr:close()
2830
process.handle:close()
2931
if code ~= 0 then
30-
process.errors = process.errors .. string.format("NvimTree system_open: return code %d.", code)
31-
error(process.errors)
32+
notify.warn(string.format("system_open failed with return code %d: %s", code, process.errors))
3233
end
3334
end
3435
)
3536
table.remove(process.args)
3637
if not process.handle then
37-
error("\n" .. process.pid .. "\nNvimTree system_open: failed to spawn process using '" .. process.cmd .. "'.")
38+
notify.warn(string.format("system_open failed to spawn command '%s': %s", process.cmd, process.pid))
3839
return
3940
end
4041
vim.loop.read_start(process.stderr, function(err, data)

0 commit comments

Comments
 (0)