2020-07-07 22:45:32 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
2019-10-15 11:48:53 +00:00
|
|
|
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
pub struct GitBranchConfig<'a> {
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub symbol: &'a str,
|
|
|
|
pub style: &'a str,
|
2019-10-15 11:48:53 +00:00
|
|
|
pub truncation_length: i64,
|
|
|
|
pub truncation_symbol: &'a str,
|
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for GitBranchConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
GitBranchConfig {
|
2020-07-07 22:45:32 +00:00
|
|
|
format: "on [$symbol$branch]($style) ",
|
|
|
|
symbol: " ",
|
|
|
|
style: "bold purple",
|
2019-10-15 11:48:53 +00:00
|
|
|
truncation_length: std::i64::MAX,
|
|
|
|
truncation_symbol: "…",
|
|
|
|
disabled: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|