summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2023-05-12 04:39:07 -0400
committerGitHub <noreply@github.com>2023-05-12 04:39:07 -0400
commitbcca7e26212734941aa0325fdd5961220d20f49a (patch)
tree42581a59c32ddce3c5017e621006db3bb34fe436
parentc8da8f16f0693c70ad0a339fdac4c4fb83274507 (diff)
bug: fix gruvbox cache colour being invalid (#1148)
* bug: fix gruvbox cache colour being invalid * update changelog
-rw-r--r--CHANGELOG.md6
-rw-r--r--src/canvas/canvas_styling.rs15
-rw-r--r--src/constants.rs2
3 files changed, 20 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 579a3884..0bcb5ed2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [0.9.1] - Unreleased
+
+## Bug Fixes
+
+- [#1148](https://github.com/ClementTsang/bottom/pull/1148): Fix Gruvbox colour string being invalid when cache usage is enabled.
+
## [0.9.0] - 2023-05-10
## Bug Fixes
diff --git a/src/canvas/canvas_styling.rs b/src/canvas/canvas_styling.rs
index ffb60cb2..e858db42 100644
--- a/src/canvas/canvas_styling.rs
+++ b/src/canvas/canvas_styling.rs
@@ -392,10 +392,10 @@ impl CanvasColours {
#[cfg(test)]
mod test {
+ use super::{CanvasColours, ColourScheme};
+ use crate::Config;
use tui::style::{Color, Style};
- use super::CanvasColours;
-
#[test]
fn default_selected_colour_works() {
let mut colours = CanvasColours::default();
@@ -423,4 +423,15 @@ mod test {
Style::default().fg(Color::Red).bg(Color::Magenta),
);
}
+
+ #[test]
+ fn test_built_in_colour_schemes() {
+ let config = Config::default();
+ CanvasColours::new(ColourScheme::Default, &config).unwrap();
+ CanvasColours::new(ColourScheme::DefaultLight, &config).unwrap();
+ CanvasColours::new(ColourScheme::Gruvbox, &config).unwrap();
+ CanvasColours::new(ColourScheme::GruvboxLight, &config).unwrap();
+ CanvasColours::new(ColourScheme::Nord, &config).unwrap();
+ CanvasColours::new(ColourScheme::NordLight, &config).unwrap();
+ }
}
diff --git a/src/constants.rs b/src/constants.rs
index c678d058..9efea3ad 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -152,7 +152,7 @@ pub static GRUVBOX_LIGHT_COLOUR_PALETTE: Lazy<ConfigColours> = Lazy::new(|| Conf
]),
ram_color: Some("#427b58".into()),
#[cfg(not(target_os = "windows"))]
- cache_color: Some("d79921".into()),
+ cache_color: Some("#d79921".into()),
swap_color: Some("#cc241d".into()),
arc_color: Some("#689d6a".into()),
gpu_core_colors: Some(vec![