mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-12-24 00:21:22 +02:00
Use github icon instead of just coloring the branch icon
This commit is contained in:
@@ -126,7 +126,7 @@ func getBranchDisplayStrings(
|
||||
pr, hasPr := prs[b.Name]
|
||||
if hasPr {
|
||||
if icons.IsIconEnabled() {
|
||||
res = append(res, prColor(pr.State).Sprint(icons.IconForBranch(b)))
|
||||
res = append(res, prColor(pr.State).Sprint(icons.IconForRemoteUrl(pr.Url)))
|
||||
} else {
|
||||
res = append(res, prColor(pr.State).Sprint("⬤"))
|
||||
}
|
||||
|
||||
@@ -79,6 +79,15 @@ func IconForRemote(remote *models.Remote) string {
|
||||
return DEFAULT_REMOTE_ICON
|
||||
}
|
||||
|
||||
func IconForRemoteUrl(url string) string {
|
||||
for domain, icon := range remoteIcons {
|
||||
if strings.Contains(url, domain) {
|
||||
return icon
|
||||
}
|
||||
}
|
||||
return DEFAULT_REMOTE_ICON
|
||||
}
|
||||
|
||||
func IconForStash(stash *models.StashEntry) string {
|
||||
return STASH_ICON
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user