Skip to content

Commit

Permalink
Merge pull request #2219 from Ryooooooga/stash-icon
Browse files Browse the repository at this point in the history
  • Loading branch information
jesseduffield authored Oct 14, 2022
2 parents 6af0afd + d90fedf commit 05089b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/gui/presentation/icons/git_icons.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const (
COMMIT_ICON = "\ufc16" // ﰖ
MERGE_COMMIT_ICON = "\ufb2c" // שּׁ
DEFAULT_REMOTE_ICON = "\uf7a1" // 
STASH_ICON = "\uf01c" // 
)

type remoteIcon struct {
Expand Down Expand Up @@ -59,3 +60,7 @@ func IconForRemote(remote *models.Remote) string {
}
return DEFAULT_REMOTE_ICON
}

func IconForStash(stash *models.StashEntry) string {
return STASH_ICON
}
9 changes: 8 additions & 1 deletion pkg/gui/presentation/stash_entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package presentation
import (
"github.com/jesseduffield/generics/slices"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/presentation/icons"
"github.com/jesseduffield/lazygit/pkg/theme"
)

Expand All @@ -19,5 +20,11 @@ func getStashEntryDisplayStrings(s *models.StashEntry, diffed bool) []string {
if diffed {
textStyle = theme.DiffTerminalColor
}
return []string{textStyle.Sprint(s.Name)}

res := make([]string, 0, 2)
if icons.IsIconEnabled() {
res = append(res, textStyle.Sprint(icons.IconForStash(s)))
}
res = append(res, textStyle.Sprint(s.Name))
return res
}

0 comments on commit 05089b9

Please sign in to comment.