sxyazi
2025-05-28 22:13:48 +08:00
parent ecffbf71dc
commit d642bfb082
15 changed files with 52 additions and 61 deletions

View File

@@ -1,4 +1,4 @@
--- @since 25.4.8
--- @since 25.5.28
local M = {}
@@ -10,13 +10,9 @@ end
function M:peek(job)
local child, err = Command("sh")
:args({
"-c",
job.args[1],
})
:arg({ "-c", job.args[1], "sh", tostring(job.file.url) })
:env("w", job.area.w)
:env("h", job.area.h)
:args({ "sh", tostring(job.file.url) })
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:spawn()
@@ -45,7 +41,7 @@ function M:peek(job)
if #errs > 0 then
fail(job, table.concat(errs, ""))
elseif job.skip > 0 and i < job.skip + limit then
ya.mgr_emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true })
ya.emit("peek", { math.max(0, i - limit), only_if = job.file.url, upper_bound = true })
else
ya.preview_widgets(job, { M.format(job, outs) })
end