mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 15:46:26 -04:00
Use github icon instead of just coloring the branch icon
This commit is contained in:
parent
f84cff3ba5
commit
95005999e6
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue