From 770c86d83a5aa316de3d0ed0f8feedfb57ad1321 Mon Sep 17 00:00:00 2001 From: bhagwan Date: Thu, 8 Feb 2024 15:30:51 -0800 Subject: [PATCH] fix(utils): `vim.system` concat stderr,stdout (closes #1032) --- lua/fzf-lua/utils.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/fzf-lua/utils.lua b/lua/fzf-lua/utils.lua index 233a24ca..852a500e 100644 --- a/lua/fzf-lua/utils.lua +++ b/lua/fzf-lua/utils.lua @@ -866,7 +866,8 @@ end function M.io_systemlist(cmd) if vim.system ~= nil then -- nvim 0.10+ local proc = vim.system(cmd):wait() - local output = proc.code == 0 and proc.stdout or proc.stderr + local output = (type(proc.stderr) == "string" and proc.stderr or "") + .. (type(proc.stdout) == "string" and proc.stdout or "") return vim.split(output, "\n", { trimempty = true }), proc.code else return vim.fn.systemlist(cmd), vim.v.shell_error @@ -879,7 +880,8 @@ end function M.io_system(cmd) if vim.system ~= nil then -- nvim 0.10+ local proc = vim.system(cmd):wait() - local output = proc.code == 0 and proc.stdout or proc.stderr + local output = (type(proc.stderr) == "string" and proc.stderr or "") + .. (type(proc.stdout) == "string" and proc.stdout or "") return output, proc.code else return vim.fn.system(cmd), vim.v.shell_error