diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2022-10-14 21:56:01 +0900 |
---|---|---|
committer | Ryooooooga <eial5q265e5@gmail.com> | 2022-10-14 21:58:58 +0900 |
commit | d90fedfbf86bb1a89373354f1b29836d1dff1db8 (patch) | |
tree | 346610d69e6c122a1c6574f9f6e26e4461b056d9 /pkg | |
parent | 6af0afdb1c8108cce12bdbd9accd952863bf3a25 (diff) |
feat: add stash icon
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/presentation/icons/git_icons.go | 5 | ||||
-rw-r--r-- | pkg/gui/presentation/stash_entries.go | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/pkg/gui/presentation/icons/git_icons.go b/pkg/gui/presentation/icons/git_icons.go index 0f891d7bd..5118652ea 100644 --- a/pkg/gui/presentation/icons/git_icons.go +++ b/pkg/gui/presentation/icons/git_icons.go @@ -13,6 +13,7 @@ const ( COMMIT_ICON = "\ufc16" // ﰖ MERGE_COMMIT_ICON = "\ufb2c" // שּׁ DEFAULT_REMOTE_ICON = "\uf7a1" // + STASH_ICON = "\uf01c" // ) type remoteIcon struct { @@ -59,3 +60,7 @@ func IconForRemote(remote *models.Remote) string { } return DEFAULT_REMOTE_ICON } + +func IconForStash(stash *models.StashEntry) string { + return STASH_ICON +} diff --git a/pkg/gui/presentation/stash_entries.go b/pkg/gui/presentation/stash_entries.go index 54b39c636..f337a4b3b 100644 --- a/pkg/gui/presentation/stash_entries.go +++ b/pkg/gui/presentation/stash_entries.go @@ -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" ) @@ -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 } |