Commit: 5b4cfa77d42b0a48f7bb858f34724dc4ccde91eb
Parent: 98b1259ded55537d92cbac57e1add655dfd9f61e
Author: Randy Palamar
Date: Sun, 16 Jul 2023 10:01:04 -0600
simplify errpipe() based on current vis:pipe() API
now the 'file' parameter can be nil and in that case range will be
ignored. this means we can collect the output of commands without hacking
around the clunky old API
Diffstat:
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/init.lua b/init.lua
@@ -8,14 +8,7 @@ local function splitext(file)
end
local function errpipe(file, cmd, p)
- local r = {start = 0, finish = 0}
- if file ~= nil then
- r = {start = 0, finish = file.size}
- else
- file = vis.win.file
- end
-
- local err, ostr, estr = vis:pipe(file, r, cmd)
+ local err, ostr, estr = vis:pipe(file, {start = 0, finish = file.size}, cmd)
if p == true and err ~= 0 and estr ~= nil then
vis:message(estr)
end