fix: only concatenate cmd.err if not nil

This commit is contained in:
Stephan Seitz 2020-09-19 15:14:11 +02:00 committed by Santos Gallegos
parent 624a6896b5
commit 8c4bc2803c

View file

@ -52,7 +52,9 @@ local function iter_cmd_sync(cmd_list)
local ret = vim.fn.system(get_command(cmd))
if vim.v.shell_error ~= 0 then
print(ret)
api.nvim_err_writeln((cmd.err..'\n' or '').."Failed to execute the following command:\n"..vim.inspect(cmd))
api.nvim_err_writeln((cmd.err and cmd.err..'\n' or '')
.."Failed to execute the following command:\n"
..vim.inspect(cmd))
return false
end