Use cosmic theme background when using cosmic syntax theme
This commit is contained in:
parent
2e5cedbb03
commit
10da8f36db
1 changed files with 6 additions and 1 deletions
|
|
@ -84,13 +84,18 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||
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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue