fix: adapt for Yazi v25.5.28
Closes https://github.com/yazi-rs/plugins/pull/116 Closes https://github.com/yazi-rs/plugins/pull/118 Closes https://github.com/yazi-rs/plugins/pull/121
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user