From ba01d90cf4caab0b24ee9572b4457d00380b84ee Mon Sep 17 00:00:00 2001 From: sxyazi Date: Wed, 25 Dec 2024 23:58:03 +0800 Subject: [PATCH] docs: v0.4 previewer `job` table changes --- docs/configuration/keymap.md | 2 ++ docs/plugins/utils.md | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/configuration/keymap.md b/docs/configuration/keymap.md index 5814a2db..b126747b 100644 --- a/docs/configuration/keymap.md +++ b/docs/configuration/keymap.md @@ -444,6 +444,8 @@ If neither `[path]` nor `--current` is specified, will use the startup directory | --------------- | ----------------------------------------------- | | `[n]` | Close the tab at position `n`, starting from 0. | +If you want to close the current tab, use the [`close`](/docs/configuration/keymap/#manager.close) command instead. + ### `tab_switch` {#manager.tab_switch} | Argument/Option | Description | diff --git a/docs/plugins/utils.md b/docs/plugins/utils.md index d71e0d26..190ec860 100644 --- a/docs/plugins/utils.md +++ b/docs/plugins/utils.md @@ -209,10 +209,10 @@ See [Async context](/docs/plugins/overview#async-context). Preview the file as code into the specified area: - `opts`: Required, the options of the preview, which is a table: - - `file`: The previewed [File](/docs/plugins/types#shared.file). - - `area`: The area of the preview, which is a [Rect](/docs/plugins/layout#rect). - - `skip`: The number of units to skip. It's units largely depend on your previewer, such as lines for code, and percentages for videos. - - `window`: The [Window](/docs/plugins/types#shared.window) of the preview. + - `area`: [Rect](/docs/plugins/layout#rect) of the available preview area. + - `file`: [File](/docs/plugins/types#shared.file) to be previewed. + - `mime`: String of the MIME type of the file. + - `skip`: Number of units to skip. The units depend on your previewer, such as lines for code and percentages for videos. Returns `(err, upper_bound)`: @@ -224,9 +224,10 @@ This function is only available in the async context. ### `preview_widgets(opts, widgets)` {#ya.preview_widgets} - `opts`: Required, the options of the preview, which is a table: - - `file`: The previewed [File](/docs/plugins/types#shared.file). - - `skip`: The number of units to skip. It's units largely depend on your previewer, such as lines for code, and percentages for videos. - - `window`: The [Window](/docs/plugins/types#shared.window) of the preview. + - `area`: [Rect](/docs/plugins/layout#rect) of the available preview area. + - `file`: [File](/docs/plugins/types#shared.file) to be previewed. + - `mime`: String of the MIME type of the file. + - `skip`: Number of units to skip. The units depend on your previewer, such as lines for code and percentages for videos. - `widgets`: List of renderable widgets, such as `{ ui.Text {...}, ui.List {...}, ... }`. This function is only available in the async context.