From 10da8f36db3401efa046ca2ff649d78e2ac64460 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 31 Jan 2024 15:26:31 -0700 Subject: [PATCH] Use cosmic theme background when using cosmic syntax theme --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c835358..9d35a16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,13 +84,18 @@ fn main() -> Result<(), Box> { SYNTAX_SYSTEM.get_or_init(|| { let lazy_theme_set = two_face::theme::LazyThemeSet::from(two_face::theme::extra()); let mut theme_set = syntect::highlighting::ThemeSet::from(&lazy_theme_set); + // Hardcoded COSMIC themes for (theme_name, theme_data) in &[ ("COSMIC Dark", cosmic_syntax_theme::COSMIC_DARK_TM_THEME), ("COSMIC Light", cosmic_syntax_theme::COSMIC_LIGHT_TM_THEME), ] { let mut cursor = io::Cursor::new(theme_data); match syntect::highlighting::ThemeSet::load_from_reader(&mut cursor) { - Ok(theme) => { + Ok(mut theme) => { + // Use cosmic theme background + theme.settings.background = Some(syntect::highlighting::Color { + r: 0, g: 0, b: 0, a: 0 + }); theme_set.themes.insert(theme_name.to_string(), theme); } Err(err) => {