history-menu (#846)

This commit is contained in:
Fernando Herrera
2022-01-25 09:39:22 +00:00
committed by GitHub
parent 0cecaf82b1
commit 69954a362d
6 changed files with 87 additions and 12 deletions

View File

@ -65,6 +65,7 @@ pub struct Config {
pub log_level: String,
pub menu_config: HashMap<String, Value>,
pub keybindings: Vec<ParsedKeybinding>,
pub history_config: HashMap<String, Value>,
}
impl Default for Config {
@ -86,6 +87,7 @@ impl Default for Config {
log_level: String::new(),
menu_config: HashMap::new(),
keybindings: Vec::new(),
history_config: HashMap::new(),
}
}
}
@ -243,6 +245,13 @@ impl Value {
eprintln!("$config.keybindings is not a valid keybindings list")
}
}
"history_config" => {
if let Ok(map) = create_map(value, &config) {
config.history_config = map;
} else {
eprintln!("$config.history_config is not a record")
}
}
x => {
eprintln!("$config.{} is an unknown config setting", x)
}