Skip to content

Commit 613df22

Browse files
committed
fix(plugins.wezterm-attention): sync with plugin's changes
Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
1 parent 88ee49f commit 613df22

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

lua/wezterm/types/plugins/attention.lua

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,21 @@
22
---@diagnostic disable:unused-local
33

44
---@enum (key) WeztermAttentionOpts.Attention
5-
local priority = {
6-
notify = 1,
7-
review = 1,
8-
stop = 1,
9-
thinking = 1,
10-
}
5+
local priority = { notify = 1, review = 1, stop = 1, thinking = 1 }
6+
7+
---@enum (key) WeztermAttentionOpts.Renderer
8+
local renderers = { manual = 1, tab = 1 }
9+
10+
---@class WeztermAttention.WrapTitleFormatterCtx
11+
---@field attention any
12+
---@field config Config
13+
---@field default_title string
14+
---@field hover boolean
15+
---@field max_width integer
16+
---@field panes PaneInformation[]
17+
---@field tabs TabInformation[]
18+
19+
---@alias WeztermAttention.TitleFormatter fun(tab: TabInformation, ctx: WeztermAttention.WrapTitleFormatterCtx): string
1120

1221
---@class WeztermAttentionOpts.ReviewKey: SendKeyParams
1322
---@field key? string
@@ -30,12 +39,18 @@ local priority = {
3039
---@field dir? string
3140
---@field indicators? WeztermAttentionOpts.Indicators
3241
---@field priority? WeztermAttentionOpts.Attention[]
42+
---@field renderer? WeztermAttentionOpts.Renderer
3343
---@field review_key? WeztermAttentionOpts.ReviewKey
44+
---@field title_formatter? WeztermAttention.TitleFormatter
3445

3546
---@class WeztermAttention
3647
---@field private _active_dir string
3748
local M = {}
3849

50+
---@param config Config
51+
---@param opts? WeztermAttentionOpts
52+
function M.apply_to_config(config, opts) end
53+
3954
---Read the cached attention state for a pane.
4055
---
4156
---Returns a `type`, `frame` tuple, or `nil`.
@@ -61,8 +76,8 @@ function M.remove_marker(pane_id, opts) end
6176
---@param opts? WeztermAttentionOpts
6277
function M.poll(window, opts) end
6378

64-
---@param config Config
65-
---@param opts? WeztermAttentionOpts
66-
function M.apply_to_config(config, opts) end
79+
---@param base_fn WeztermAttention.TitleFormatter
80+
---@return fun(tab: TabInformation, tabs: TabInformation[], panes: PaneInformation[], config: Config, hover: boolean, max_width: integer): string|FormatItem
81+
function M.wrap_title_formatter(base_fn) end
6782

6883
-- vim: set ts=2 sts=2 sw=2 et ai si sta:

0 commit comments

Comments
 (0)