use rmpv::Value;
use super::ParseError;
#[derive(Debug)]
pub enum OptionSet {
AmbiWidth(String),
ArabicShape(bool),
Emoji(bool),
GUIFont(String),
GUIFontSet(String),
GUIFontWide(String),
LineSpace(i64),
PumBlend(u64),
ShowTabLine(u64),
TermGUIColors(bool),
Other,
}
impl TryFrom<&Vec<Value>> for OptionSet {
type Error = ParseError;
fn try_from(values: &Vec<Value>) -> Result<Self, Self::Error> {
let name = values.get(0).unwrap().as_str().unwrap();
match name {
"emoji" => {
let value = values.get(1).unwrap().as_bool().unwrap();
Ok(OptionSet::Emoji(value))
}
v => {
eprintln!("option_set {v}");
Ok(OptionSet::Other)
}
}
}
}