feat: more Yazi v25.5.28 goodies

This commit is contained in:
sxyazi
2025-05-28 23:06:18 +08:00
parent d642bfb082
commit f9b3f8876e
23 changed files with 45 additions and 55 deletions

View File

@@ -5,7 +5,7 @@ Pipe any shell command as a previewer.
## Installation
```sh
ya pack -a yazi-rs/plugins:piper
ya pkg add yazi-rs/plugins:piper
```
## Usage

View File

@@ -2,11 +2,7 @@
local M = {}
local function fail(job, s)
ya.preview_widgets(job, {
ui.Text.parse(s):area(job.area):wrap(ui.Text.WRAP),
})
end
local function fail(job, s) ya.preview_widget(job, ui.Text.parse(s):area(job.area):wrap(ui.Wrap.YES)) end
function M:peek(job)
local child, err = Command("sh")
@@ -43,7 +39,7 @@ function M:peek(job)
elseif job.skip > 0 and i < job.skip + limit then
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) })
ya.preview_widget(job, M.format(job, outs))
end
end