24 lines
624 B
Rust
24 lines
624 B
Rust
//! Built-in `ThemeDefinition` presets (D11).
|
|
|
|
use crate::definition::ThemeDefinition;
|
|
|
|
const TOKYO_NIGHT: &str = include_str!("../presets/tokyo-night.toml");
|
|
|
|
pub fn preset_names() -> &'static [&'static str] {
|
|
&["tokyo-night"]
|
|
}
|
|
|
|
/// Parses the named preset.
|
|
pub fn builtin(name: &str) -> Option<ThemeDefinition> {
|
|
match name {
|
|
"tokyo-night" => match ThemeDefinition::parse_toml(TOKYO_NIGHT) {
|
|
Ok(def) => Some(def),
|
|
Err(err) => {
|
|
eprintln!("bundled preset tokyo-night failed to parse: {err}");
|
|
None
|
|
}
|
|
},
|
|
_ => None,
|
|
}
|
|
}
|