diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-26 14:48:57 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-26 14:50:13 +0300 |
| commit | 57c880f0ebaa5011abc90f4e2fd4f84fc072ce35 (patch) | |
| tree | 9f662b19cec2e9c9e50e87eb5e96def9e8ae9822 /src/config | |
| parent | 9eec3029e13b791b8a4954e38d5bb7db6e2ff68f (diff) | |
feat: add global last-pane navigation
refs #287
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/keybinds.rs | 8 | ||||
| -rw-r--r-- | src/config/model.rs | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/config/keybinds.rs b/src/config/keybinds.rs index 9235cf05..ea7f411c 100644 --- a/src/config/keybinds.rs +++ b/src/config/keybinds.rs @@ -288,6 +288,7 @@ pub struct Keybinds { pub focus_pane_right: ActionKeybinds, pub cycle_pane_next: ActionKeybinds, pub cycle_pane_previous: ActionKeybinds, + pub last_pane: ActionKeybinds, pub split_vertical: ActionKeybinds, pub split_horizontal: ActionKeybinds, pub close_pane: ActionKeybinds, @@ -463,6 +464,7 @@ impl Config { focus_pane_down: action!("keys.focus_pane_down", &self.keys.focus_pane_down), focus_pane_up: action!("keys.focus_pane_up", &self.keys.focus_pane_up), focus_pane_right: action!("keys.focus_pane_right", &self.keys.focus_pane_right), + last_pane: action!("keys.last_pane", &self.keys.last_pane), cycle_pane_next: action!("keys.cycle_pane_next", &self.keys.cycle_pane_next), cycle_pane_previous: action!( "keys.cycle_pane_previous", @@ -1265,6 +1267,12 @@ next_tab = "prefix+n" } #[test] + fn back_and_forth_keybinds_are_unset_by_default() { + let kb = Config::default().keybinds(); + assert!(kb.last_pane.bindings.is_empty()); + } + + #[test] fn array_bindings_allow_prefix_and_modified_direct() { let config: Config = toml::from_str( r#" diff --git a/src/config/model.rs b/src/config/model.rs index 7434c924..d4830df1 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -211,6 +211,8 @@ pub struct KeysConfig { pub cycle_pane_next: BindingConfig, /// Cycle to the previous pane. Default: "prefix+shift+tab". pub cycle_pane_previous: BindingConfig, + /// Focus the last focused pane across workspaces and tabs. Unset by default. + pub last_pane: BindingConfig, /// Split pane vertically (side by side). Default: "prefix+v" pub split_vertical: BindingConfig, /// Split pane horizontally (stacked). Default: "prefix+minus" @@ -391,6 +393,7 @@ impl Default for KeysConfig { focus_pane_right: BindingConfig::one("prefix+l"), cycle_pane_next: BindingConfig::one("prefix+tab"), cycle_pane_previous: BindingConfig::one("prefix+shift+tab"), + last_pane: BindingConfig::empty(), split_vertical: BindingConfig::one("prefix+v"), split_horizontal: BindingConfig::one("prefix+minus"), close_pane: BindingConfig::one("prefix+x"), |
