2022-03-26 09:42:19 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2019-10-26 06:20:20 +00:00
|
|
|
|
2022-03-26 09:42:19 +00:00
|
|
|
#[derive(Clone, Deserialize, Serialize)]
|
2022-04-01 15:14:05 +00:00
|
|
|
#[cfg_attr(feature = "config-schema", derive(schemars::JsonSchema))]
|
2022-03-26 09:42:19 +00:00
|
|
|
#[serde(default)]
|
2019-10-26 06:20:20 +00:00
|
|
|
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,
|
2021-08-07 17:22:00 +00:00
|
|
|
pub up_to_date: &'a str,
|
2020-07-07 22:45:32 +00:00
|
|
|
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,
|
2021-12-30 21:12:53 +00:00
|
|
|
pub ignore_submodules: bool,
|
2019-10-26 06:20:20 +00:00
|
|
|
pub disabled: bool,
|
2022-03-07 03:18:23 +00:00
|
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
|
|
pub windows_starship: Option<&'a str>,
|
2019-10-26 06:20:20 +00:00
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for GitStatusConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2019-10-26 06:20:20 +00:00
|
|
|
GitStatusConfig {
|
2020-07-07 22:45:32 +00:00
|
|
|
format: "([\\[$all_status$ahead_behind\\]]($style) )",
|
|
|
|
style: "red bold",
|
|
|
|
stashed: "\\$",
|
|
|
|
ahead: "⇡",
|
|
|
|
behind: "⇣",
|
2021-08-07 17:22:00 +00:00
|
|
|
up_to_date: "",
|
2020-07-07 22:45:32 +00:00
|
|
|
diverged: "⇕",
|
|
|
|
conflicted: "=",
|
|
|
|
deleted: "✘",
|
|
|
|
renamed: "»",
|
|
|
|
modified: "!",
|
|
|
|
staged: "+",
|
|
|
|
untracked: "?",
|
2021-12-30 21:12:53 +00:00
|
|
|
ignore_submodules: false,
|
2019-10-26 06:20:20 +00:00
|
|
|
disabled: false,
|
2022-03-07 03:18:23 +00:00
|
|
|
windows_starship: None,
|
2019-10-26 06:20:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|