aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKunal Mohan <kunalmohan99@gmail.com>2021-05-25 13:20:30 +0530
committerKunal Mohan <kunalmohan99@gmail.com>2021-05-25 13:20:30 +0530
commit151deb323578d599b9358db072b52ca712d950c6 (patch)
tree3fa7522c3045d59e5c88570b1125396086b2a5b1
parentCHange keybind for Session mode and add comments for clarity (diff)
downloadsl0ppij-151deb323578d599b9358db072b52ca712d950c6.tar.gz
sl0ppij-151deb323578d599b9358db072b52ca712d950c6.tar.xz
sl0ppij-151deb323578d599b9358db072b52ca712d950c6.zip
remove shortened_text mode from status-bar
-rw-r--r--default-plugins/status-bar/src/first_line.rs46
-rw-r--r--zellij-server/src/lib.rs2
2 files changed, 1 insertions, 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,
@@ -259,15 +222,6 @@ fn key_indicators(
}
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);
line_part.len += key.len;
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<dyn ServerOsApi>, socket_path: PathBuf) {
}
ServerInstruction::Render(output) => {
if *session_state.read().unwrap() == SessionState::Attached {
- // Here output is of type Option<String> sent by screen thread.
+ // Here output is of the type Option<String> 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 {