diff options
| author | DawidPietrykowski <53954695+DawidPietrykowski@users.noreply.github.com> | 2026-06-25 18:12:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-25 18:12:51 +0200 |
| commit | ebd731b0ff12737a6e2160a255280534ef3991bd (patch) | |
| tree | 4313963a269205391aa519fd090ea1de2b7cc4af /zellij-utils/src/kdl | |
| parent | tests: add more integration tests (#5308) (diff) | |
| download | sl0ppij-ebd731b0ff12737a6e2160a255280534ef3991bd.tar.gz sl0ppij-ebd731b0ff12737a6e2160a255280534ef3991bd.tar.xz sl0ppij-ebd731b0ff12737a6e2160a255280534ef3991bd.zip | |
feat(panes): `FocusLastPane` action (#4241)
* feat(panes): focus last pane (#4142)
* add tests
* add client id parameter to `add_floating_pane`
* add action for floating panes
* add tests for floating panes
* add keybinds to configs
* rebase fixes
* simplify focus logic when adding stacked pane
* formatting fix
* formatting fix 2
* fix: make sure expanding pane always focuses it for all clients in stack
* add pr
* fix rebase
---------
Co-authored-by: Aram Drevekenin <aram@poor.dev>
Diffstat (limited to 'zellij-utils/src/kdl')
| -rw-r--r-- | zellij-utils/src/kdl/mod.rs | 6 | ||||
| -rw-r--r-- | zellij-utils/src/kdl/snapshots/zellij_utils__kdl__keybinds_to_string_with_all_actions.snap | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/zellij-utils/src/kdl/mod.rs b/zellij-utils/src/kdl/mod.rs index 0164ef92..14695f68 100644 --- a/zellij-utils/src/kdl/mod.rs +++ b/zellij-utils/src/kdl/mod.rs @@ -48,6 +48,7 @@ macro_rules! parse_kdl_action_arguments { "Quit" => Ok(Action::Quit), "FocusNextPane" => Ok(Action::FocusNextPane), "FocusPreviousPane" => Ok(Action::FocusPreviousPane), + "FocusLastPane" => Ok(Action::FocusLastPane), "SwitchFocus" => Ok(Action::SwitchFocus), "EditScrollback" => Ok(Action::EditScrollback { ansi: false }), "ScrollUp" => Ok(Action::ScrollUp), @@ -660,6 +661,7 @@ impl Action { }, Action::FocusNextPane => Some(KdlNode::new("FocusNextPane")), Action::FocusPreviousPane => Some(KdlNode::new("FocusPreviousPane")), + Action::FocusLastPane => Some(KdlNode::new("FocusLastPane")), Action::SwitchFocus => Some(KdlNode::new("SwitchFocus")), Action::MoveFocus { direction } => { let mut node = KdlNode::new("MoveFocus"); @@ -1512,6 +1514,9 @@ impl TryFrom<(&KdlNode, &Options)> for Action { "FocusPreviousPane" => { parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) }, + "FocusLastPane" => { + parse_kdl_action_arguments!(action_name, action_arguments, kdl_action) + }, "SwitchFocus" => parse_kdl_action_arguments!(action_name, action_arguments, kdl_action), "EditScrollback" => { let ansi = crate::kdl_get_bool_property_or_child_value!(kdl_action, "ansi") @@ -6729,6 +6734,7 @@ fn keybinds_to_string_with_all_actions() { config_key_2 "config_value_2"; }; } + bind "Ctrl Alt k" { FocusLastPane; } } }"#; let document: KdlDocument = fake_config.parse().unwrap(); diff --git a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__keybinds_to_string_with_all_actions.snap b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__keybinds_to_string_with_all_actions.snap index 43e85faa..b0119a63 100644 --- a/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__keybinds_to_string_with_all_actions.snap +++ b/zellij-utils/src/kdl/snapshots/zellij_utils__kdl__keybinds_to_string_with_all_actions.snap @@ -1,6 +1,5 @@ --- source: zellij-utils/src/kdl/mod.rs -assertion_line: 2731 expression: serialized.to_string() --- keybinds clear-defaults=true { @@ -47,6 +46,7 @@ keybinds clear-defaults=true { } bind "Alt j" { GoToPreviousTab; } bind "Ctrl k" { MovePane "right"; } + bind "Ctrl Alt k" { FocusLastPane; } bind "Alt k" { CloseTab; } bind "Ctrl l" { MovePaneBackwards; } bind "Alt l" { GoToTab 1; } @@ -127,4 +127,3 @@ keybinds clear-defaults=true { bind "Alt z" { SearchInput 0; } } } - |
