Skip to content

Commit

Permalink
fix: only render if hideClean is false and there are stashes (#93)
Browse files Browse the repository at this point in the history
* fix: only render if hideClean is false and there are stashes

* fix: test
  • Loading branch information
joshmedeski committed Mar 22, 2023
1 parent 395d66d commit 25d89f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tmux/formater.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ func (f *Formater) flags() string {
flags = append(flags, fmt.Sprintf("%s%s", f.Styles.Clean, f.Symbols.Clean))
}

return f.Styles.Clear + strings.Join(flags, " ")
if len(flags) != 0 {
return f.Styles.Clear + strings.Join(flags, " ")
}
}

if f.st.NumStaged != 0 {
Expand Down
2 changes: 1 addition & 1 deletion tmux/formater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func TestFormat(t *testing.T) {
options: options{
HideClean: true,
},
want: "StyleClear",
want: "",
},
{
name: "hide clean option false",
Expand Down

0 comments on commit 25d89f7

Please sign in to comment.