diff options
Diffstat (limited to 'crates/turtle/src/atuin_history')
| -rw-r--r-- | crates/turtle/src/atuin_history/stats.rs | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/crates/turtle/src/atuin_history/stats.rs b/crates/turtle/src/atuin_history/stats.rs index 12d1ffc5..2328eeca 100644 --- a/crates/turtle/src/atuin_history/stats.rs +++ b/crates/turtle/src/atuin_history/stats.rs @@ -4,7 +4,7 @@ use crossterm::style::{Color, ResetColor, SetAttribute, SetForegroundColor}; use serde::{Deserialize, Serialize}; use unicode_segmentation::UnicodeSegmentation; -use crate::atuin_client::{history::History, settings::Settings, theme::Meaning, theme::Theme}; +use crate::atuin_client::{history::History, settings::Settings}; #[derive(Debug, Clone, Serialize, Deserialize)] pub(crate) struct Stats { @@ -162,7 +162,7 @@ fn strip_leading_env_vars(command: &str) -> &str { command[token_start_pos..].trim() } -pub(crate) fn pretty_print(stats: Stats, ngram_size: usize, theme: &Theme) { +pub(crate) fn pretty_print(stats: Stats, ngram_size: usize) { let max = stats.top.iter().map(|x| x.1).max().unwrap(); let num_pad = max.ilog10() as usize + 1; @@ -179,42 +179,21 @@ pub(crate) fn pretty_print(stats: Stats, ngram_size: usize, theme: &Theme) { }); for (command, count) in stats.top { - let gray = SetForegroundColor(match theme.as_style(Meaning::Muted).foreground_color { - Some(color) => color, - None => Color::Grey, - }); + let gray = SetForegroundColor(Color::Grey); let bold = SetAttribute(crossterm::style::Attribute::Bold); let in_ten = 10 * count / max; print!("["); - print!( - "{}", - SetForegroundColor(match theme.get_error().foreground_color { - Some(color) => color, - None => Color::Red, - }) - ); + print!("{}", SetForegroundColor(Color::Red)); for i in 0..in_ten { if i == 2 { - print!( - "{}", - SetForegroundColor(match theme.get_warning().foreground_color { - Some(color) => color, - None => Color::Yellow, - }) - ); + print!("{}", SetForegroundColor(Color::Yellow)); } if i == 5 { - print!( - "{}", - SetForegroundColor(match theme.get_info().foreground_color { - Some(color) => color, - None => Color::Green, - }) - ); + print!("{}", SetForegroundColor(Color::Green)); } print!("▮"); |
