common: Add Item hierarchy in config

To avoid confusion, this moves the config "display_dir" to a new
section named "Item". For now this is the only config this new section
will have.
This commit is contained in:
Lux Aliaga 2023-08-26 11:24:15 -04:00
parent 1506dc811c
commit e9aa1b2ee1
1 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,12 @@ pub struct DeserializedConfig {
pub display_colors: bool,
}
#[derive(Debug, Deserialize)]
#[allow(unused)]
struct Item {
display_dir: bool,
}
#[derive(Debug, Deserialize)]
#[allow(unused)]
struct History {
@ -117,7 +123,7 @@ pub fn parse_config() -> Result<DeserializedConfig> {
Err(_) => String::new(),
};
display_dir = settings.get_bool("display_dir").unwrap_or(true);
display_dir = settings.get_bool("item.display_dir").unwrap_or(true);
history_display_dir = settings.get_bool("history.display_dir").unwrap_or(true);
display_emoji = settings.get_bool("display_emoji").unwrap_or(true);
display_colors = settings.get_bool("display_colors").unwrap_or(true);