aboutsummaryrefslogtreecommitdiff
path: root/src/config
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-17 03:50:22 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-17 03:50:22 +0300
commitd743b39a2b922aa9f7c4365a0b6e53a8be68b9e6 (patch)
tree2474b99b66fe3e57ca6f6c8991063c454c8dcd2d /src/config
parent510f56e1ce3f671a6a2457032a44188997ef0764 (diff)
chore: rename fullscreen keybinding to zoom
Diffstat (limited to 'src/config')
-rw-r--r--src/config/keybinds.rs29
-rw-r--r--src/config/model.rs7
2 files changed, 24 insertions, 12 deletions
diff --git a/src/config/keybinds.rs b/src/config/keybinds.rs
index 9a1dc496..13d65ec3 100644
--- a/src/config/keybinds.rs
+++ b/src/config/keybinds.rs
@@ -111,8 +111,8 @@ pub struct Keybinds {
pub split_horizontal_label: String,
pub close_pane: (KeyCode, KeyModifiers),
pub close_pane_label: String,
- pub fullscreen: (KeyCode, KeyModifiers),
- pub fullscreen_label: String,
+ pub zoom: (KeyCode, KeyModifiers),
+ pub zoom_label: String,
pub resize_mode: (KeyCode, KeyModifiers),
pub resize_mode_label: String,
pub toggle_sidebar: (KeyCode, KeyModifiers),
@@ -362,8 +362,8 @@ impl Config {
),
required_binding(
BindingScope::Navigate,
- "keys.fullscreen",
- &self.keys.fullscreen,
+ "keys.zoom",
+ &self.keys.zoom,
"f",
(KeyCode::Char('f'), KeyModifiers::empty()),
&mut diagnostics,
@@ -791,8 +791,8 @@ impl Config {
split_horizontal_label: bindings[5].label.clone(),
close_pane: bindings[6].value,
close_pane_label: bindings[6].label.clone(),
- fullscreen: bindings[7].value,
- fullscreen_label: bindings[7].label.clone(),
+ zoom: bindings[7].value,
+ zoom_label: bindings[7].label.clone(),
resize_mode: bindings[8].value,
resize_mode_label: bindings[8].label.clone(),
toggle_sidebar: bindings[9].value,
@@ -1093,7 +1093,7 @@ mod tests {
assert_eq!(kb.split_horizontal.0, KeyCode::Char('-'));
assert_eq!(kb.close_pane.0, KeyCode::Char('x'));
assert_eq!(kb.edit_scrollback, None);
- assert_eq!(kb.fullscreen.0, KeyCode::Char('f'));
+ assert_eq!(kb.zoom.0, KeyCode::Char('f'));
assert_eq!(kb.resize_mode.0, KeyCode::Char('r'));
assert_eq!(kb.toggle_sidebar.0, KeyCode::Char('b'));
assert!(kb.custom_commands.is_empty());
@@ -1110,7 +1110,7 @@ close_workspace = "ctrl+d"
split_vertical = "s"
split_horizontal = "shift+s"
close_pane = "ctrl+w"
-fullscreen = "z"
+zoom = "z"
resize_mode = "ctrl+r"
toggle_sidebar = "tab"
previous_agent = "alt+a"
@@ -1143,7 +1143,7 @@ focus_pane_right = "alt+right"
(KeyCode::Char('s'), KeyModifiers::SHIFT)
);
assert_eq!(kb.close_pane, (KeyCode::Char('w'), KeyModifiers::CONTROL));
- assert_eq!(kb.fullscreen.0, KeyCode::Char('z'));
+ assert_eq!(kb.zoom.0, KeyCode::Char('z'));
assert_eq!(kb.resize_mode, (KeyCode::Char('r'), KeyModifiers::CONTROL));
assert_eq!(kb.toggle_sidebar, (KeyCode::Tab, KeyModifiers::empty()));
assert_eq!(
@@ -1168,6 +1168,17 @@ focus_pane_right = "alt+right"
}
#[test]
+ fn legacy_fullscreen_keybind_alias_maps_to_zoom() {
+ let toml = r#"
+[keys]
+fullscreen = "z"
+"#;
+ let config: Config = toml::from_str(toml).unwrap();
+ let kb = config.keybinds();
+ assert_eq!(kb.zoom.0, KeyCode::Char('z'));
+ }
+
+ #[test]
fn uppercase_keybind_from_toml_flows_into_shift_combo() {
let toml = r#"
[keys]
diff --git a/src/config/model.rs b/src/config/model.rs
index f9522e41..60a8859c 100644
--- a/src/config/model.rs
+++ b/src/config/model.rs
@@ -119,8 +119,9 @@ pub struct KeysConfig {
pub split_horizontal: String,
/// Close the focused pane. Default: "x"
pub close_pane: String,
- /// Toggle fullscreen for the focused pane. Default: "f"
- pub fullscreen: String,
+ /// Toggle zoom for the focused pane. Default: "f"
+ #[serde(alias = "fullscreen")]
+ pub zoom: String,
/// Enter resize mode. Default: "r"
pub resize_mode: String,
/// Toggle sidebar collapse. Default: "b"
@@ -210,7 +211,7 @@ impl Default for KeysConfig {
split_vertical: "v".into(),
split_horizontal: "-".into(),
close_pane: "x".into(),
- fullscreen: "f".into(),
+ zoom: "f".into(),
resize_mode: "r".into(),
toggle_sidebar: "b".into(),
indexed: IndexedKeysConfig::default(),