From eb6e49c260be568800e76fd3276fc96ad909d4eb Mon Sep 17 00:00:00 2001 From: Lovecraftian Horror Date: Fri, 9 Jul 2021 15:21:47 -0400 Subject: Move `ModeInfo::new()` back to `get_mode_info()` --- zellij-tile/src/data.rs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'zellij-tile/src') diff --git a/zellij-tile/src/data.rs b/zellij-tile/src/data.rs index 48ef4df9e..cdf57e69f 100644 --- a/zellij-tile/src/data.rs +++ b/zellij-tile/src/data.rs @@ -151,49 +151,6 @@ pub struct ModeInfo { pub session_name: Option, } -impl ModeInfo { - /// Creates a [`ModeInfo`] struct indicating the current [`InputMode`] and its keybinds - /// (as pairs of [`String`]s). - pub fn new(mode: InputMode, palette: Palette, capabilities: PluginCapabilities) -> Self { - let keybinds = match mode { - InputMode::Normal | InputMode::Locked => Vec::new(), - InputMode::Resize => vec![("←↓↑→".to_string(), "Resize".to_string())], - InputMode::Pane => vec![ - ("←↓↑→".to_string(), "Move focus".to_string()), - ("p".to_string(), "Next".to_string()), - ("n".to_string(), "New".to_string()), - ("d".to_string(), "Down split".to_string()), - ("r".to_string(), "Right split".to_string()), - ("x".to_string(), "Close".to_string()), - ("f".to_string(), "Fullscreen".to_string()), - ], - InputMode::Tab => vec![ - ("←↓↑→".to_string(), "Move focus".to_string()), - ("n".to_string(), "New".to_string()), - ("x".to_string(), "Close".to_string()), - ("r".to_string(), "Rename".to_string()), - ("s".to_string(), "Sync".to_string()), - ], - InputMode::Scroll => vec![ - ("↓↑".to_string(), "Scroll".to_string()), - ("PgUp/PgDn".to_string(), "Scroll Page".to_string()), - ], - InputMode::RenameTab => vec![("Enter".to_string(), "when done".to_string())], - InputMode::Session => vec![("d".to_string(), "Detach".to_string())], - }; - - let session_name = std::env::var("ZELLIJ_SESSION_NAME").ok(); - - Self { - mode, - keybinds, - palette, - capabilities, - session_name, - } - } -} - #[derive(Debug, Default, Clone, PartialEq, Eq, Hash, Deserialize, Serialize)] pub struct TabInfo { /* subset of fields to publish to plugins */ -- cgit v1.2.3