OSX: use stdout instead of stderr due to rendering issues (#287, #316)

This commit is contained in:
bhagwan 2022-01-18 18:39:43 -08:00
parent e383be5cff
commit e89d5bc009

View File

@ -298,6 +298,8 @@ M.spawn_stdio = function(opts, fn_transform, fn_preprocess)
-- io.stdout:write(("%d %s\n"):format(i, vim.v.argv[i])) -- io.stdout:write(("%d %s\n"):format(i, vim.v.argv[i]))
-- end -- end
local is_darwin = vim.loop.os_uname().sysname == 'Darwin'
if opts.debug then if opts.debug then
io.stdout:write("[DEBUG]: "..opts.cmd.."\n") io.stdout:write("[DEBUG]: "..opts.cmd.."\n")
end end
@ -384,7 +386,13 @@ M.spawn_stdio = function(opts, fn_transform, fn_preprocess)
if stderr then if stderr then
pipe_write(stderr, data) pipe_write(stderr, data)
else else
io.stderr:write(data) if is_darwin then
-- for some reason io:stderr causes
-- weird rendering issues on Mac (#316, #287)
io.stdout:write(data)
else
io.stderr:write(data)
end
end end
end end