summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Pankratz <panki312@gmail.com>2023-01-27 13:37:18 +0100
committerGitHub <noreply@github.com>2023-01-27 13:37:18 +0100
commita369e70d941de4bd5e8f3ca4c24ba3cd4c9a197b (patch)
tree30d91c34545a38a81bafa7b0b9bcd57872588e34
parente5c590c286eab9534de9ae6ce14e52572df18bf9 (diff)
fix(status-bar): not displaying w/ size=1 and show shortcuts (#2091)
* Fix status bar not displaying if size=1. Show shortcuts if not in normal mode when size=1 * formatting Co-authored-by: Felix Pankratz <mail@felixpankratz.de>
-rw-r--r--default-plugins/status-bar/src/main.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs
index 027425a3a..9a110310a 100644
--- a/default-plugins/status-bar/src/main.rs
+++ b/default-plugins/status-bar/src/main.rs
@@ -248,10 +248,26 @@ impl ZellijPlugin for State {
// [m is background reset, [0K is so that it clears the rest of the line
match background {
PaletteColor::Rgb((r, g, b)) => {
- println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b);
+ if rows > 1 {
+ println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b);
+ } else {
+ if self.mode_info.mode == InputMode::Normal {
+ print!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", first_line, r, g, b);
+ } else {
+ print!("\u{1b}[m{}\u{1b}[0K", second_line);
+ }
+ }
},
PaletteColor::EightBit(color) => {
- println!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color);
+ if rows > 1 {
+ println!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color);
+ } else {
+ if self.mode_info.mode == InputMode::Normal {
+ print!("{}\u{1b}[48;5;{}m\u{1b}[0K", first_line, color);
+ } else {
+ print!("\u{1b}[m{}\u{1b}[0K", second_line);
+ }
+ }
},
}