Skip to content

Commit

Permalink
fix(status-bar): not displaying w/ size=1 and show shortcuts (#2091)
Browse files Browse the repository at this point in the history
* Fix status bar not displaying if size=1. Show shortcuts if not in normal mode when size=1

* formatting

Co-authored-by: Felix Pankratz <[email protected]>
  • Loading branch information
panki27 and panki27 authored Jan 27, 2023
1 parent e5c590c commit a369e70
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions default-plugins/status-bar/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
},
}

Expand Down

0 comments on commit a369e70

Please sign in to comment.