summaryrefslogtreecommitdiffstats
path: root/src/configs/directory.rs
blob: 9c6aaf26ee922b0096ff973817f4ea4c611073ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use crate::config::{ModuleConfig, RootModuleConfig};
use std::collections::HashMap;

use ansi_term::{Color, Style};
use starship_module_config_derive::ModuleConfig;

#[derive(Clone, ModuleConfig)]
pub struct DirectoryConfig<'a> {
    pub truncation_length: i64,
    pub truncate_to_repo: bool,
    pub substitutions: HashMap<String, &'a str>,
    pub fish_style_pwd_dir_length: i64,
    pub use_logical_path: bool,
    pub prefix: &'a str,
    pub style: Style,
    pub disabled: bool,
}

impl<'a> RootModuleConfig<'a> for DirectoryConfig<'a> {
    fn new() -> Self {
        DirectoryConfig {
            truncation_length: 3,
            truncate_to_repo: true,
            fish_style_pwd_dir_length: 0,
            substitutions: HashMap::new(),
            use_logical_path: true,
            prefix: "in ",
            style: Color::Cyan.bold(),
            disabled: false,
        }
    }
}