mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	feat: add stash icon
This commit is contained in:
		| @@ -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 | ||||
| } | ||||
|   | ||||
| @@ -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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user