2020-07-07 22:45:32 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
2019-10-26 06:20:20 +00:00
|
|
|
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
pub struct GitStatusConfig<'a> {
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub style: &'a str,
|
|
|
|
pub stashed: &'a str,
|
|
|
|
pub ahead: &'a str,
|
|
|
|
pub behind: &'a str,
|
|
|
|
pub diverged: &'a str,
|
|
|
|
pub conflicted: &'a str,
|
|
|
|
pub deleted: &'a str,
|
|
|
|
pub renamed: &'a str,
|
|
|
|
pub modified: &'a str,
|
|
|
|
pub staged: &'a str,
|
|
|
|
pub untracked: &'a str,
|
2019-10-26 06:20:20 +00:00
|
|
|
pub disabled: bool,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for GitStatusConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
GitStatusConfig {
|
2020-07-07 22:45:32 +00:00
|
|
|
format: "([\\[$all_status$ahead_behind\\]]($style) )",
|
|
|
|
style: "red bold",
|
|
|
|
stashed: "\\$",
|
|
|
|
ahead: "⇡",
|
|
|
|
behind: "⇣",
|
|
|
|
diverged: "⇕",
|
|
|
|
conflicted: "=",
|
|
|
|
deleted: "✘",
|
|
|
|
renamed: "»",
|
|
|
|
modified: "!",
|
|
|
|
staged: "+",
|
|
|
|
untracked: "?",
|
2019-10-26 06:20:20 +00:00
|
|
|
disabled: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|