summaryrefslogtreecommitdiffstats
path: root/default-plugins
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2022-11-15 12:21:36 +0100
committerGitHub <noreply@github.com>2022-11-15 12:21:36 +0100
commit3d2a6d6a5aa47cace356fe39184f2ac018898552 (patch)
tree3f57d6b63bd5943224139bfc65bb4ff562bf0f91 /default-plugins
parentb2b5bdc564920fa09c9c54f04c593e411497121d (diff)
refactor(plugins): change the data flow (#1934)
* refactor(plugins): do not block render loop * refactor(plugins): cleanup * style(fmt): rustfmt * fix(plugins): various rendering pipeline fixes
Diffstat (limited to 'default-plugins')
-rw-r--r--default-plugins/compact-bar/src/main.rs4
-rw-r--r--default-plugins/status-bar/src/main.rs2
-rw-r--r--default-plugins/strider/src/main.rs15
-rw-r--r--default-plugins/tab-bar/src/main.rs4
4 files changed, 17 insertions, 8 deletions
diff --git a/default-plugins/compact-bar/src/main.rs b/default-plugins/compact-bar/src/main.rs
index 2d52a6f9d..5dc8f2ffa 100644
--- a/default-plugins/compact-bar/src/main.rs
+++ b/default-plugins/compact-bar/src/main.rs
@@ -129,10 +129,10 @@ impl ZellijPlugin for State {
};
match background {
PaletteColor::Rgb((r, g, b)) => {
- println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", s, r, g, b);
+ print!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", s, r, g, b);
},
PaletteColor::EightBit(color) => {
- println!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color);
+ print!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color);
},
}
self.should_render = false;
diff --git a/default-plugins/status-bar/src/main.rs b/default-plugins/status-bar/src/main.rs
index 800fb82c4..25e31d2f5 100644
--- a/default-plugins/status-bar/src/main.rs
+++ b/default-plugins/status-bar/src/main.rs
@@ -232,7 +232,7 @@ impl ZellijPlugin for State {
}
if rows > 1 {
- println!("\u{1b}[m{}\u{1b}[0K", second_line);
+ print!("\u{1b}[m{}\u{1b}[0K", second_line);
}
}
}
diff --git a/default-plugins/strider/src/main.rs b/default-plugins/strider/src/main.rs
index 22ca1c614..fcac6ec6a 100644
--- a/default-plugins/strider/src/main.rs
+++ b/default-plugins/strider/src/main.rs
@@ -93,6 +93,7 @@ impl ZellijPlugin for State {
*self.scroll_mut() = self.selected() + 2 - rows;
}
+ let is_last_row = i == rows.saturating_sub(1);
let i = self.scroll() + i;
if let Some(entry) = self.files.get(i) {
let mut path = entry.as_line(cols).normal();
@@ -102,11 +103,19 @@ impl ZellijPlugin for State {
}
if i == self.selected() {
- println!("{}", path.reversed());
+ if is_last_row {
+ print!("{}", path.reversed());
+ } else {
+ println!("{}", path.reversed());
+ }
} else {
- println!("{}", path);
+ if is_last_row {
+ print!("{}", path);
+ } else {
+ println!("{}", path);
+ }
}
- } else {
+ } else if !is_last_row {
println!();
}
}
diff --git a/default-plugins/tab-bar/src/main.rs b/default-plugins/tab-bar/src/main.rs
index 562e27793..f03102610 100644
--- a/default-plugins/tab-bar/src/main.rs
+++ b/default-plugins/tab-bar/src/main.rs
@@ -127,10 +127,10 @@ impl ZellijPlugin for State {
};
match background {
PaletteColor::Rgb((r, g, b)) => {
- println!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", s, r, g, b);
+ print!("{}\u{1b}[48;2;{};{};{}m\u{1b}[0K", s, r, g, b);
},
PaletteColor::EightBit(color) => {
- println!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color);
+ print!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color);
},
}
self.should_render = false;