Select syntax theme based on system theme, update cosmic-text

This commit is contained in:
Jeremy Soller 2023-11-02 12:56:59 -06:00
parent cec433085a
commit 6f0994f752
No known key found for this signature in database
GPG key ID: DCFCA852D3906975
4 changed files with 55 additions and 38 deletions

View file

@ -3,7 +3,7 @@
use cosmic_text::{Attrs, Buffer, Edit, Metrics, SyntaxEditor, ViEditor, Wrap};
use std::{fs, path::PathBuf, sync::Mutex};
use crate::{fl, Config, FONT_SYSTEM, SYNTAX_SYSTEM};
use crate::{fl, text_box, Config, FONT_SYSTEM, SYNTAX_SYSTEM};
static FONT_SIZES: &'static [Metrics] = &[
Metrics::new(10.0, 14.0), // Caption
@ -27,7 +27,7 @@ impl Tab {
let editor = SyntaxEditor::new(
Buffer::new(&mut FONT_SYSTEM.lock().unwrap(), FONT_SIZES[1 /* Body */]),
&SYNTAX_SYSTEM,
"base16-eighties.dark",
text_box::Appearance::dark().syntax_theme,
)
.unwrap();