Skip to content

Commit

Permalink
fix(utils): vim.system concat stderr,stdout (closes #1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibhagwan committed Feb 8, 2024
1 parent 8245720 commit 770c86d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/fzf-lua/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 770c86d

Please sign in to comment.