1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-27 20:59:02 +00:00
starship/src/configs/git_branch.rs
Sagittarius-a 688f1b3457
feat(git_branch): add remote branch name if different than local branch (#1915)
* feat(git_branch): add remote branch name if different than local branch

* feat(git_branch): Implement a more customizable remote branch

* feat(git_branch): Use more explicit API function name

* feat(git_branch): Remove forgotten draft documentation

* feat(git_branch): Set less verbose defaults

* feat(git_branch): Handle case to always display remote

* feat(git_branch): Fix error in rebase operation
2020-11-23 22:07:16 +01:00

31 lines
843 B
Rust

use crate::config::{ModuleConfig, RootModuleConfig};
use starship_module_config_derive::ModuleConfig;
#[derive(Clone, ModuleConfig)]
pub struct GitBranchConfig<'a> {
pub format: &'a str,
pub symbol: &'a str,
pub style: &'a str,
pub truncation_length: i64,
pub truncation_symbol: &'a str,
pub only_attached: bool,
pub always_show_remote: bool,
pub disabled: bool,
}
impl<'a> RootModuleConfig<'a> for GitBranchConfig<'a> {
fn new() -> Self {
GitBranchConfig {
format: "on [$symbol$branch]($style)(:[$remote]($style)) ",
symbol: "",
style: "bold purple",
truncation_length: std::i64::MAX,
truncation_symbol: "",
only_attached: false,
always_show_remote: false,
disabled: false,
}
}
}