Skip to content

Commit a7aec50

Browse files
committed
fix: combine KeyAssignmentLiterals|Actions into the Action alias
Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
1 parent 484bf53 commit a7aec50

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

lua/wezterm/types/enum/key-assignment.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ local launcher_args_flags = {
516516
---@alias InputSelector fun(params: InputSelectorParams): { InputSelector: InputSelectorParams }
517517
---@alias MoveTab fun(index: T<integer>): { MoveTab: T<integer> }
518518
---@alias MoveTabRelative fun(index: T<integer>): { MoveTabRelative: T<integer> }
519-
---@alias Multiple fun(events: (Actions|KeyAssignmentLiterals)[]): { Multiple: (Actions|KeyAssignment)[] }
519+
---@alias Multiple fun(events: Action[]): { Multiple: Action[] }
520520
---@alias PaneSelect PaneSelectParams|fun(params: PaneSelectParams): { PaneSelect: PaneSelectParams }
521521
---@alias PasteFrom fun(source: ClipboardPasteDestination): { PasteFrom: ClipboardPasteDestination }
522522
---@alias PromptInputLine fun(params: PromptInputLineParams): { PromptInputLine: PromptInputLineParams }
@@ -560,7 +560,7 @@ local launcher_args_flags = {
560560
---|{ InputSelector: InputSelectorParams }
561561
---|{ MoveTab: integer }
562562
---|{ MoveTabRelative: integer }
563-
---|{ Multiple: (Actions|KeyAssignment)[] }
563+
---|{ Multiple: Action[] }
564564
---|{ PaneSelect: PaneSelectParams }
565565
---|{ PasteFrom: ClipboardPasteDestination }
566566
---|{ PromptInputLine: PromptInputLineParams }
@@ -987,4 +987,6 @@ local key_assignment = {
987987
TogglePaneZoomState = 1,
988988
}
989989

990+
---@alias Action (Actions|KeyAssignmentLiterals)
991+
990992
-- vim: set ts=2 sts=2 sw=2 et ai si sta:

lua/wezterm/types/objects/window.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function M:mux_window() end
170170
---against a pane in a window when configured via the keys
171171
---and mouse configuration options.
172172
---
173-
---@param key_assignment KeyAssignmentLiterals|Actions
173+
---@param key_assignment Action
174174
---@param pane Pane
175175
function M:perform_action(key_assignment, pane) end
176176

lua/wezterm/types/plugins/modal_wezterm.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ function M.reset_window_title(pane) end
4747
---
4848
---@param name string
4949
---@param activate_key_table_params? ActivateKeyTableParams
50-
---@return KeyAssignmentLiterals|Actions key_assignment
50+
---@return Action key_assignment
5151
function M.activate_mode(name, activate_key_table_params) end
5252

5353
---Exits active mode.
5454
---
5555
---@param name string
56-
---@return KeyAssignmentLiterals|Actions key_assignment
56+
---@return Action key_assignment
5757
function M.exit_mode(name) end
5858

5959
---Exits all active modes
6060
---@param name string
61-
---@return KeyAssignmentLiterals|Actions key_assignment
61+
---@return Action key_assignment
6262
function M.exit_all_modes(name) end
6363

6464
---@param config Config

lua/wezterm/types/wezterm.lua

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,9 @@ end
663663
---Can be any key assignment action.
664664
---
665665
---For more information, see:
666-
--- - [`KeyAssignmentLiterals`](lua://KeyAssignmentLiterals)
667-
--- - [`Actions`](lua://Actions)
666+
--- - [`Action`](lua://Action)
668667
---
669-
---@field action KeyAssignmentLiterals|Actions
668+
---@field action Action
670669
---**(OPTIONAL)** Nerd Fonts glyph name to use for the icon for the entry.
671670
---
672671
---For a list of icon names, see:
@@ -714,7 +713,7 @@ end
714713
---@field wezterm_version? string
715714
---@field aliases? string[]
716715

717-
---@alias ActionCallback fun(win: Window, pane: Pane, ...: any): false|KeyAssignmentLiterals|Actions|nil
716+
---@alias ActionCallback fun(win: Window, pane: Pane, ...: any): any
718717

719718
---@enum (key) CursorStyle
720719
local cursor_style = {
@@ -793,7 +792,7 @@ local weight = {
793792

794793
---@class KeyBinding
795794
---@field key string
796-
---@field action KeyAssignmentLiterals|Actions
795+
---@field action Action
797796
---@field mods? string
798797

799798
---@class MouseEventInfo
@@ -813,7 +812,7 @@ local weight = {
813812

814813
---@class MouseBindingBase
815814
---@field event MouseEvent
816-
---@field action KeyAssignmentLiterals|Actions
815+
---@field action Action
817816
---@field mouse_reporting? boolean
818817
---@field alt_screen? boolean|"Any"
819818

@@ -1577,7 +1576,7 @@ function Wezterm.on(event, callback) end
15771576
---This is the `+` button that is drawn to the right of the last tab.
15781577
---
15791578
---@param event "new-tab-button-click"
1580-
---@param callback fun(window: Window, pane: Pane, button: "Left"|"Middle"|"Right", default_action: KeyAssignmentLiterals|Actions)
1579+
---@param callback fun(window: Window, pane: Pane, button: "Left"|"Middle"|"Right", default_action: Action)
15811580
function Wezterm.on(event, callback) end
15821581

15831582
--- - The first event parameter is a [`Window`](lua://Window)

0 commit comments

Comments
 (0)