Skip to content

Commit 3dc3ff2

Browse files
authored
[REFACTOR] Stick to LuaCATS-like comments (#51)
2 parents 7753b91 + 2e5c73e commit 3dc3ff2

31 files changed

Lines changed: 2439 additions & 2439 deletions

lua/types/config.lua

Lines changed: 885 additions & 885 deletions
Large diffs are not rendered by default.

lua/types/enum/copy-mode-assignment.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
---|"Output"
1313
---|"Prompt"
1414

15-
-- Represents a pre-defined function that can be applied to control `CopyMode`
16-
-- and [Search Mode](https://wezterm.org/scrollback.html#enabledisable-scrollbar)
15+
---Represents a pre-defined function that can be applied to control `CopyMode`
16+
---and [Search Mode](https://wezterm.org/scrollback.html#enabledisable-scrollbar)
1717
---@alias CopyModeAssignment
1818
---|"AcceptPattern" Takes `CopyMode` / `SearchMode` out of editing mode: keyboard input will no longer be directed to the search pattern editor
1919
---|"ClearPattern" Clear the `CopyMode` / `SearchMode` search pattern

lua/types/enum/key-assignment.lua

Lines changed: 84 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---@meta
22

3-
-- TODO: Make key and mods more specific
3+
---TODO: Make key and mods more specific
44

55
---@alias KeyAssignment
66
---|"ActivateCommandPalette"
@@ -85,94 +85,93 @@
8585
---|"TogglePaneZoomState"
8686

8787
---@class KeyNoAction
88-
-- A single unicode character, like 'A' or 'a'. Pay attention to the case of the text that you use
89-
-- and the state of the SHIFT modifier, as this matters whether 'A' or 'a' is matched.
90-
--
91-
-- Alternatively you can use on the following keycode identifiers, although note that not all of
92-
-- these are meaningful on all platforms:
93-
--
94-
-- Hyper, Super, Meta, Cancel, Backspace, Tab, Clear, Enter, Shift, Escape, LeftShift, RightShift,
95-
-- Control, LeftControl, RightControl, Alt, LeftAlt, RightAlt, Menu, LeftMenu, RightMenu, Pause,
96-
-- CapsLock, VoidSymbol, PageUp, PageDown, End, Home, LeftArrow, RightArrow, UpArrow, DownArrow,
97-
-- Select, Print, Execute, PrintScreen, Insert, Delete, Help, LeftWindows, RightWindows,
98-
-- Applications, Sleep, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7,
99-
-- Numpad8, Numpad9, Multiply, Add, Separator, Subtract, Decimal, Divide, NumLock, ScrollLock,
100-
-- BrowserBack, BrowserForward, BrowserRefresh, BrowserStop, BrowserSearch, BrowserFavorites,
101-
-- BrowserHome, VolumeMute, VolumeDown, VolumeUp, MediaNextTrack, MediaPrevTrack, MediaStop,
102-
-- MediaPlayPause, ApplicationLeftArrow, ApplicationRightArrow, ApplicationUpArrow,
103-
-- ApplicationDownArrow, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17,
104-
-- F18, F19, F20, F21, F22, F23, F24.
105-
--
106-
-- The key value can refer either to the physical position of a key on an ANSI US keyboard or to the
107-
-- post-keyboard-layout-mapped value produced by a key press.
108-
--
109-
-- You can explicitly assign using the physical position by adding a phys: prefix to the value, for
110-
-- example: `key="phys:A"`. This will match key presses for the key that would be in the position of
111-
-- the A key on an ANSI US keyboard.
112-
--
113-
-- You can explicitly assign the mapped key by adding a mapped:
114-
-- prefix to the value, for example: key="mapped:a" will match a
115-
-- key press where the OS keyboard layout produces a, regardless of
116-
-- its physical position.
117-
--
118-
-- If you omit an explicit prefix, wezterm will assume phys: and use the physical position of the
119-
-- specified key.
120-
--
121-
-- The default key assignments listed above use `phys:`. In previous releases there was no physical
122-
-- position support and those assignments were all `mapped:`.
123-
--
124-
-- When upgrading from earlier releases, if you had `{key="N", mods="CMD", ..}` in your config, you
125-
-- will need to change it to either `{key="N", mods="CMD|SHIFT", ..}` or `{ key="mapped:N",
126-
-- mods="CMD", ..}` in order to continue to respect the SHIFT modifier.
127-
--
128-
-- The `key_map_preference` option controls how keys without an explicit `phys:` or `mapped:` prefix
129-
-- are treated. If `key_map_preference = "Mapped"` (the default), then `mapped:` is assumed. If
130-
-- `key_map_preference = "Physical"` then `phys:` is assumed.
131-
--
132-
-- The default key assignments will respect `key_map_preference`.
133-
--
134-
-- In some cases, wezterm may not know how to represent a key event in either its phys: or mapped:
135-
-- forms. In that case, you may wish to define an assignment in terms of the underlying operating
136-
-- system key code, using a `raw: prefix`.
137-
--
138-
-- Similar in concept to the `phys:` mapping described above, the `raw:` mapping is independent of
139-
-- the OS keyboard layout. Raw codes are hardware and windowing system dependent, so there is no
140-
-- portable way to list which key does what.
141-
--
142-
-- To discover these values, you can set `debug_key_events = true` and press the keys of interest.
143-
--
144-
-- You can specify a raw key value of 123 by using `key="raw:123"` in your config rather than one of
145-
-- the other key values.
146-
--
88+
---A single unicode character, like 'A' or 'a'. Pay attention to the case of the text that you use
89+
---and the state of the SHIFT modifier, as this matters whether 'A' or 'a' is matched.
90+
---
91+
---Alternatively you can use on the following keycode identifiers, although note that not all of
92+
---these are meaningful on all platforms:
93+
---
94+
---Hyper, Super, Meta, Cancel, Backspace, Tab, Clear, Enter, Shift, Escape, LeftShift, RightShift,
95+
---Control, LeftControl, RightControl, Alt, LeftAlt, RightAlt, Menu, LeftMenu, RightMenu, Pause,
96+
---CapsLock, VoidSymbol, PageUp, PageDown, End, Home, LeftArrow, RightArrow, UpArrow, DownArrow,
97+
---Select, Print, Execute, PrintScreen, Insert, Delete, Help, LeftWindows, RightWindows,
98+
---Applications, Sleep, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7,
99+
---Numpad8, Numpad9, Multiply, Add, Separator, Subtract, Decimal, Divide, NumLock, ScrollLock,
100+
---BrowserBack, BrowserForward, BrowserRefresh, BrowserStop, BrowserSearch, BrowserFavorites,
101+
---BrowserHome, VolumeMute, VolumeDown, VolumeUp, MediaNextTrack, MediaPrevTrack, MediaStop,
102+
---MediaPlayPause, ApplicationLeftArrow, ApplicationRightArrow, ApplicationUpArrow,
103+
---ApplicationDownArrow, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17,
104+
---F18, F19, F20, F21, F22, F23, F24.
105+
---
106+
---The key value can refer either to the physical position of a key on an ANSI US keyboard or to the
107+
---post-keyboard-layout-mapped value produced by a key press.
108+
---
109+
---You can explicitly assign using the physical position by adding a phys: prefix to the value, for
110+
---example: `key="phys:A"`. This will match key presses for the key that would be in the position of
111+
---the A key on an ANSI US keyboard.
112+
---
113+
---You can explicitly assign the mapped key by adding a mapped:
114+
---prefix to the value, for example: key="mapped:a" will match a
115+
---key press where the OS keyboard layout produces a, regardless of
116+
---its physical position.
117+
---
118+
---If you omit an explicit prefix, wezterm will assume phys: and use the physical position of the
119+
---specified key.
120+
---
121+
---The default key assignments listed above use `phys:`. In previous releases there was no physical
122+
---position support and those assignments were all `mapped:`.
123+
---
124+
---When upgrading from earlier releases, if you had `{key="N", mods="CMD", ..}` in your config, you
125+
---will need to change it to either `{key="N", mods="CMD|SHIFT", ..}` or `{ key="mapped:N",
126+
---mods="CMD", ..}` in order to continue to respect the SHIFT modifier.
127+
---
128+
---The `key_map_preference` option controls how keys without an explicit `phys:` or `mapped:` prefix
129+
---are treated. If `key_map_preference = "Mapped"` (the default), then `mapped:` is assumed. If
130+
---`key_map_preference = "Physical"` then `phys:` is assumed.
131+
---
132+
---The default key assignments will respect `key_map_preference`.
133+
---
134+
---In some cases, wezterm may not know how to represent a key event in either its phys: or mapped:
135+
---forms. In that case, you may wish to define an assignment in terms of the underlying operating
136+
---system key code, using a `raw: prefix`.
137+
---
138+
---Similar in concept to the `phys:` mapping described above, the `raw:` mapping is independent of
139+
---the OS keyboard layout. Raw codes are hardware and windowing system dependent, so there is no
140+
---portable way to list which key does what.
141+
---
142+
---To discover these values, you can set `debug_key_events = true` and press the keys of interest.
143+
---
144+
---You can specify a raw key value of 123 by using `key="raw:123"` in your config rather than one of
145+
---the other key values.
146+
---
147147
---@field key string
148-
-- Possible Modifier labels are:
149-
--
150-
-- `SUPER`, `CMD`, `WIN` - these are all equivalent: on macOS the Command key, on Windows the
151-
-- Windows key, on Linux this can also be the Super or Hyper key. Left and right are equivalent.
152-
--
153-
-- `CTRL` - The control key. Left and right are equivalent.
154-
--
155-
-- `SHIFT` - The shift key. Left and right are equivalent.
156-
--
157-
-- `ALT`, `OPT`, `META` - these are all equivalent: on macOS the Option key, on other systems the
158-
-- Alt or Meta key. Left and right are equivalent.
159-
--
160-
-- `LEADER` - a special modal modifier state managed by WezTerm.
161-
--
162-
-- `VoidSymbol` - This keycode is emitted in special cases where the original function of the key has
163-
-- been removed. Such as in Linux and using setxkbmap: `setxkbmap -option caps:none`. The CapsLock
164-
-- will no longer function as before in all applications, instead emitting `VoidSymbol`.
165-
166-
-- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`.
167-
--
148+
---Possible Modifier labels are:
149+
---
150+
---`SUPER`, `CMD`, `WIN` - these are all equivalent: on macOS the Command key, on Windows the
151+
---Windows key, on Linux this can also be the Super or Hyper key. Left and right are equivalent.
152+
---
153+
---`CTRL` - The control key. Left and right are equivalent.
154+
---
155+
---`SHIFT` - The shift key. Left and right are equivalent.
156+
---
157+
---`ALT`, `OPT`, `META` - these are all equivalent: on macOS the Option key, on other systems the
158+
---Alt or Meta key. Left and right are equivalent.
159+
---
160+
---`LEADER` - a special modal modifier state managed by WezTerm.
161+
---
162+
---`VoidSymbol` - This keycode is emitted in special cases where the original function of the key has
163+
---been removed. Such as in Linux and using setxkbmap: `setxkbmap -option caps:none`. The CapsLock
164+
---will no longer function as before in all applications, instead emitting `VoidSymbol`.
165+
---You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`.
166+
---
168167
---@field mods? string Optional modifiers keys.
169168

170169
---@class Key :KeyNoAction
171170
---@field action KeyAssignment
172171

173172
---@alias KeyAssignFunction fun(param: any): KeyAssignment
174173

175-
-- Can also be called as function like older versions of wezterm did
174+
---Can also be called as function like older versions of wezterm did
176175
---@class ActionFuncClass
177176
---@field ActivateCommandPalette KeyAssignFunction
178177
---@field ActivateCopyMode KeyAssignFunction
@@ -337,8 +336,8 @@
337336
---@field ToggleFullScreen any
338337
---@field TogglePaneZoomState any
339338

340-
-- Helper for defining key assignment actions in your configuration file.
341-
-- This is really just sugar for the underlying Lua -> Rust deserialation mapping
342-
-- that makes it a bit easier to identify where syntax errors may exist
343-
-- in your configuration file
339+
---Helper for defining key assignment actions in your configuration file.
340+
---This is really just sugar for the underlying Lua -> Rust deserialation mapping
341+
---that makes it a bit easier to identify where syntax errors may exist
342+
---in your configuration file
344343
---@alias Action ActionFuncClass|fun(action: ActionClass)

lua/types/events/gui.lua

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
---@meta
22

3-
-- This event is triggered when the GUI is starting up after attaching the selected domain.
4-
-- For example, when you use `wezterm connect DOMAIN` or `wezterm start --domain DOMAIN`to start the GUI,
5-
-- the `gui-attached` event will be triggered and passed the `MuxDomain` object associated with `DOMAIN`.
6-
--
7-
-- In cases where you don't specify the domain, the default domain will be passed instead.
8-
--
9-
-- This event fires after the `gui-startup` event.
10-
--
11-
-- Note that the `gui-startup` event does not fire when invoking `wezterm connect DOMAIN`
12-
-- or `wezterm start --domain DOMAIN --attach`
3+
---This event is triggered when the GUI is starting up after attaching the selected domain.
4+
---For example, when you use `wezterm connect DOMAIN` or `wezterm start --domain DOMAIN`to start the GUI,
5+
---the `gui-attached` event will be triggered and passed the `MuxDomain` object associated with `DOMAIN`.
6+
---
7+
---In cases where you don't specify the domain, the default domain will be passed instead.
8+
---
9+
---This event fires after the `gui-startup` event.
10+
---
11+
---Note that the `gui-startup` event does not fire when invoking `wezterm connect DOMAIN`
12+
---or `wezterm start --domain DOMAIN --attach`
1313
---@alias GuiAttached "gui-attached"
1414

15-
-- The `gui-startup` event is emitted once when the GUI server is starting up when running the
16-
-- `wezterm start` subcommand.
17-
--
18-
-- If no explicit program was passed to `wezterm start`, and if the `gui-startup` event
19-
-- causes any panes to be created then those will take precedence
20-
-- over the default program configuration
21-
-- and no additional default program will be spawned.
22-
--
23-
-- This event is useful for starting a set of programs in a standard configuration
24-
-- to save you the effort of doing it manually each time.
25-
--
26-
--
27-
-- - It is triggered before any default program is started
28-
-- - This event fires before `gui-attached`
29-
-- - This event does not fire for `wezterm connect` invocations
30-
-- - The event receives an optional `SpawnCommand` argument that corresponds to
31-
-- any arguments that may have been passed via `wezterm start`.
32-
-- In earlier releases if you implemented this event,
33-
-- you would essentially prevent `wezterm start -- something`
34-
-- from spawning something.
35-
--
36-
-- The intent is for you to use the information in the command object to spawn a new window,
37-
-- but you can choose to use or ignore it as suits your purpose
15+
---The `gui-startup` event is emitted once when the GUI server is starting up when running the
16+
---`wezterm start` subcommand.
17+
---
18+
---If no explicit program was passed to `wezterm start`, and if the `gui-startup` event
19+
---causes any panes to be created then those will take precedence
20+
---over the default program configuration
21+
---and no additional default program will be spawned.
22+
---
23+
---This event is useful for starting a set of programs in a standard configuration
24+
---to save you the effort of doing it manually each time.
25+
---
26+
---
27+
--- - It is triggered before any default program is started
28+
--- - This event fires before `gui-attached`
29+
--- - This event does not fire for `wezterm connect` invocations
30+
--- - The event receives an optional `SpawnCommand` argument that corresponds to
31+
--- any arguments that may have been passed via `wezterm start`.
32+
--- In earlier releases if you implemented this event,
33+
--- you would essentially prevent `wezterm start -- something`
34+
--- from spawning something.
35+
---
36+
---The intent is for you to use the information in the command object to spawn a new window,
37+
---but you can choose to use or ignore it as suits your purpose
3838
---@alias GuiStartup "gui-startup"
3939

4040
---@alias GuiEvent

lua/types/events/multiplexer.lua

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
---@meta
22

3-
-- The `mux-is-process-stateful` event is emitted when the multiplexer layer
4-
-- wants to determine whether a given `Pane` can be closed
5-
-- without prompting the user.
6-
--
7-
-- - This event is synchronous and must return as quickly as possible
8-
-- in order to avoid blocking the multiplexer
9-
-- - The event is passed a `LocalProcessInfo` object representing the process
10-
-- that corresponds to the pane
11-
--
12-
-- The hook can return one of the following values:
13-
-- - `true`: to indicate that this process tree is considered to be stateful
14-
-- and that the user should be prompted before terminating the pane
15-
-- - `false`: to indicate that the process tree can be terminated without prompting the user
16-
--
17-
-- Any other value means to use the default behavior, which is to consider the
18-
-- `skip_close_confirmation_for_processes_named` configuration option
19-
--
3+
---The `mux-is-process-stateful` event is emitted when the multiplexer layer
4+
---wants to determine whether a given `Pane` can be closed
5+
---without prompting the user.
6+
---
7+
--- - This event is synchronous and must return as quickly as possible
8+
--- in order to avoid blocking the multiplexer
9+
--- - The event is passed a `LocalProcessInfo` object representing the process
10+
--- that corresponds to the pane
11+
---
12+
---The hook can return one of the following values:
13+
--- - `true`: to indicate that this process tree is considered to be stateful
14+
--- and that the user should be prompted before terminating the pane
15+
--- - `false`: to indicate that the process tree can be terminated without prompting the user
16+
---
17+
---Any other value means to use the default behavior, which is to consider the
18+
---`skip_close_confirmation_for_processes_named` configuration option
19+
---
2020
---@alias MuxProcessStateful "mux-is-process-stateful"
2121

22-
-- The `mux-startup` event is emitted once when the mux server is starting up.
23-
-- It is triggered before any default program is started.
24-
--
25-
-- If the `mux-startup` event causes any panes to be created then
26-
-- those will take precedence over the default program configuration
27-
-- and no additional default program will be spawned.
28-
--
29-
-- This event is useful for starting a set of programs in a standard configuration
30-
-- to save you the effort of doing it manually each time
22+
---The `mux-startup` event is emitted once when the mux server is starting up.
23+
---It is triggered before any default program is started.
24+
---
25+
---If the `mux-startup` event causes any panes to be created then
26+
---those will take precedence over the default program configuration
27+
---and no additional default program will be spawned.
28+
---
29+
---This event is useful for starting a set of programs in a standard configuration
30+
---to save you the effort of doing it manually each time
3131
---@alias MuxStartup "mux-startup"
3232

3333
---@alias MultiplexerEvent

0 commit comments

Comments
 (0)