feat: adds option to hide clean flag

This commit is contained in:
Josh Medeski 2023-03-07 19:47:02 -06:00
parent 595c9fde2f
commit 5f8ad64c2e
2 changed files with 7 additions and 1 deletions

View file

@ -79,3 +79,5 @@ tmux:
branch_trim: right
# Character indicating whether and where a branch was truncated.
ellipsis:
# Hides the clean flag
hide_clean: false

View file

@ -89,6 +89,7 @@ type options struct {
BranchMaxLen int `yaml:"branch_max_len"`
BranchTrim direction `yaml:"branch_trim"`
Ellipsis string `yaml:"ellipsis"`
HideClean bool `yaml:"hide_clean"`
}
// A Formater formats git status to a tmux style string.
@ -256,7 +257,10 @@ func (f *Formater) flags() {
fmt.Sprintf("%s%s%d", f.Styles.Stashed, f.Symbols.Stashed, f.st.NumStashed))
}
flags = append(flags, fmt.Sprintf("%s%s", f.Styles.Clean, f.Symbols.Clean))
if f.Options.HideClean != true {
flags = append(flags, fmt.Sprintf("%s%s", f.Styles.Clean, f.Symbols.Clean))
}
f.clear()
f.b.WriteString(strings.Join(flags, " "))
return