From e89d5bc009be8a631d5708701722fc30232879ee Mon Sep 17 00:00:00 2001 From: bhagwan Date: Tue, 18 Jan 2022 18:39:43 -0800 Subject: [PATCH] OSX: use stdout instead of stderr due to rendering issues (#287, #316) --- lua/fzf-lua/libuv.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lua/fzf-lua/libuv.lua b/lua/fzf-lua/libuv.lua index c33ade5..3ce3e6f 100644 --- a/lua/fzf-lua/libuv.lua +++ b/lua/fzf-lua/libuv.lua @@ -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])) -- end + local is_darwin = vim.loop.os_uname().sysname == 'Darwin' + if opts.debug then io.stdout:write("[DEBUG]: "..opts.cmd.."\n") end @@ -384,7 +386,13 @@ M.spawn_stdio = function(opts, fn_transform, fn_preprocess) if stderr then pipe_write(stderr, data) 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