diff options
| author | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-12-31 18:24:33 +0100 |
|---|---|---|
| committer | Daniel Jankowski <daniel.jankowski@rub.de> | 2023-12-31 18:24:33 +0100 |
| commit | 250b0c98c5f8d31d74e724fadf9398d714236e64 (patch) | |
| tree | 267e0d298ebc85d376b8b27e1e4441202bda4a10 /src | |
| parent | chore: bump version to v0.11.2 (diff) | |
| download | sl0pstatus-250b0c98c5f8d31d74e724fadf9398d714236e64.tar.gz sl0pstatus-250b0c98c5f8d31d74e724fadf9398d714236e64.tar.xz sl0pstatus-250b0c98c5f8d31d74e724fadf9398d714236e64.zip | |
chore: move from cargo-wasi to cargo-component and fix criterion
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/zjstatus.rs | 14 | ||||
| -rw-r--r-- | src/config.rs | 10 |
2 files changed, 11 insertions, 13 deletions
diff --git a/src/bin/zjstatus.rs b/src/bin/zjstatus.rs index 0b12993..37aa18f 100644 --- a/src/bin/zjstatus.rs +++ b/src/bin/zjstatus.rs @@ -15,7 +15,7 @@ use std::{collections::BTreeMap, sync::Arc, usize}; use uuid::Uuid; use zjstatus::{ - config::{self, ZellijState, UpdateEventMask}, + config::{self, UpdateEventMask, ZellijState}, frames, widgets, }; @@ -182,8 +182,11 @@ impl ZellijPlugin for State { self.state.cols = cols; - self.module_config - .render_bar(self.state.clone(), self.widget_map.clone()); + print!( + "{}", + self.module_config + .render_bar(self.state.clone(), self.widget_map.clone()) + ); } } @@ -202,10 +205,7 @@ fn register_widgets(configuration: &BTreeMap<String, String>) -> BTreeMap<String "swap_layout".to_owned(), Arc::new(SwapLayoutWidget::new(configuration)), ); - widget_map.insert( - "mode".to_owned(), - Arc::new(ModeWidget::new(configuration)), - ); + widget_map.insert("mode".to_owned(), Arc::new(ModeWidget::new(configuration))); widget_map.insert( "session".to_owned(), Arc::new(SessionWidget::new(configuration)), diff --git a/src/config.rs b/src/config.rs index 4a95d32..736edbb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -198,7 +198,7 @@ impl ModuleConfig { &mut self, state: ZellijState, widget_map: BTreeMap<String, Arc<dyn Widget>>, - ) { + ) -> String { let output_left = self.left_parts.iter_mut().fold("".to_owned(), |acc, part| { format!( "{acc}{}", @@ -227,7 +227,7 @@ impl ModuleConfig { border_bottom = format!("\n{}", self.border.draw(state.cols)); } - print!( + return format!( "{}{}{}{}{}", border_top, output_left, @@ -235,16 +235,14 @@ impl ModuleConfig { output_right, border_bottom, ); - - return; } - print!( + format!( "{}{}{}", output_left, self.get_spacer(&output_left, &output_right, state.cols), output_right, - ); + ) } fn get_spacer(&self, output_left: &str, output_right: &str, cols: usize) -> String { |
