From 151deb323578d599b9358db072b52ca712d950c6 Mon Sep 17 00:00:00 2001 From: Kunal Mohan Date: Tue, 25 May 2021 13:20:30 +0530 Subject: [PATCH] remove shortened_text mode from status-bar --- default-plugins/status-bar/src/first_line.rs | 46 -------------------- zellij-server/src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/default-plugins/status-bar/src/first_line.rs b/default-plugins/status-bar/src/first_line.rs index a8bc19cd..7a678cdc 100644 --- a/default-plugins/status-bar/src/first_line.rs +++ b/default-plugins/status-bar/src/first_line.rs @@ -43,17 +43,6 @@ impl CtrlKeyShortcut { CtrlKeyAction::Session => String::from("SESSION"), } } - pub fn shortened_text(&self) -> String { - match self.action { - CtrlKeyAction::Lock => String::from("LOCK"), - CtrlKeyAction::Pane => String::from("ane"), - CtrlKeyAction::Tab => String::from("ab"), - CtrlKeyAction::Resize => String::from("esize"), - CtrlKeyAction::Scroll => String::from("croll"), - CtrlKeyAction::Quit => String::from("uit"), - CtrlKeyAction::Session => String::from("sess"), - } - } pub fn letter_shortcut(&self) -> char { match self.action { CtrlKeyAction::Lock => 'g', @@ -197,32 +186,6 @@ fn full_ctrl_key(key: &CtrlKeyShortcut, palette: ColoredElements, separator: &st } } -fn shortened_ctrl_key( - key: &CtrlKeyShortcut, - palette: ColoredElements, - separator: &str, -) -> LinePart { - let shortened_text = key.shortened_text(); - let letter_shortcut = key.letter_shortcut(); - let shortened_text = match key.action { - CtrlKeyAction::Lock => format!(" {}", shortened_text), - _ => shortened_text, - }; - match key.mode { - CtrlKeyMode::Unselected => { - unselected_mode_shortcut(letter_shortcut, &shortened_text, palette, separator) - } - CtrlKeyMode::Selected => { - selected_mode_shortcut(letter_shortcut, &shortened_text, palette, separator) - } - CtrlKeyMode::Disabled => disabled_mode_shortcut( - &format!(" <{}>{}", letter_shortcut, shortened_text), - palette, - separator, - ), - } -} - fn single_letter_ctrl_key( key: &CtrlKeyShortcut, palette: ColoredElements, @@ -258,15 +221,6 @@ fn key_indicators( return line_part; } line_part = LinePart::default(); - for ctrl_key in keys { - let key = shortened_ctrl_key(ctrl_key, palette, separator); - line_part.part = format!("{}{}", line_part.part, key.part); - line_part.len += key.len; - } - if line_part.len < max_len { - return line_part; - } - line_part = LinePart::default(); for ctrl_key in keys { let key = single_letter_ctrl_key(ctrl_key, palette, separator); line_part.part = format!("{}{}", line_part.part, key.part); diff --git a/zellij-server/src/lib.rs b/zellij-server/src/lib.rs index aeb13cb5..40fb87f7 100644 --- a/zellij-server/src/lib.rs +++ b/zellij-server/src/lib.rs @@ -265,7 +265,7 @@ pub fn start_server(os_input: Box, socket_path: PathBuf) { } ServerInstruction::Render(output) => { if *session_state.read().unwrap() == SessionState::Attached { - // Here output is of type Option sent by screen thread. + // Here output is of the type Option sent by screen thread. // If `Some(_)`- unwrap it and forward it to the client to render. // If `None`- Send an exit instruction. This is the case when the user closes last Tab/Pane. if let Some(op) = output {