Docs: improve doc structure for action bindings with args and examples

minor doc changes
This commit is contained in:
Erlend Lind Madsen
2025-01-24 14:55:33 +07:00
parent 1baf8928a0
commit 076bcccde4

View File

@ -280,8 +280,15 @@ pub const Action = union(enum) {
scroll_page_fractional: f32,
scroll_page_lines: i16,
/// Adjust an existing selection in a given direction. This action
/// does nothing if there is no active selection.
/// Adjust the current selection in a given direction. Does nothing if no
/// selection exists.
///
/// Arguments:
/// - AdjustSelection: left, right, up, down, page_up, page_down, home, end,
/// beginning_of_line, end_of_line
///
/// Example: Extend selection to the right
/// keybind = shift+right=adjust_selection:right
adjust_selection: AdjustSelection,
/// Jump the viewport forward or back by prompt. Positive number is the
@ -337,25 +344,47 @@ pub const Action = union(enum) {
/// This only works with libadwaita enabled currently.
toggle_tab_overview: void,
/// Create a new split in the given direction. The new split will appear in
/// the direction given. For example `new_split:up`. Valid values are left, right, up, down and auto.
/// Create a new split in the given direction.
///
/// Arguments:
/// - SplitDirection: right, down, left, up, auto (along the larger dir)
///
/// Example: Create split on the right
/// keybind = cmd+shift+d=new_split:right
new_split: SplitDirection,
/// Focus on a split in a given direction. For example `goto_split:up`. Valid values are left, right, up, down, previous and next.
/// Focus a split in a given direction.
///
/// Arguments:
/// - SplitFocusDirection: previous, next, up, left, down, right
///
/// Example: Focus split on the right
/// keybind = cmd+right=goto_split:right
goto_split: SplitFocusDirection,
/// zoom/unzoom the current split.
toggle_split_zoom: void,
/// Resize the current split by moving the split divider in the given
/// direction. For example `resize_split:left,10`. The valid directions are up, down, left and right.
/// Resize the current split in a given direction.
///
/// Arguments:
/// - SplitResizeDirection: up, down, left, right
/// - The number of pixels to resize the split by
///
/// Example: Move divider up 10 pixels
/// keybind = cmd+shift+up=resize_split:up,10
resize_split: SplitResizeParameter,
/// Equalize all splits in the current window
equalize_splits: void,
/// Show, hide, or toggle the terminal inspector for the currently focused
/// terminal.
/// Control the terminal inspector visibility.
///
/// Arguments:
/// - InspectorMode: toggle, show, hide
///
/// Example: Toggle inspector visibility
/// keybind = cmd+i=inspector:toggle
inspector: InspectorMode,
/// Open the configuration file in the default OS editor. If your default OS
@ -504,7 +533,6 @@ pub const Action = union(enum) {
pub const SplitFocusDirection = enum {
previous,
next,
up,
left,
down,