1
0
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:
Stefan Haller
2025-10-16 14:42:08 +02:00
parent f772dac603
commit b31421201a
2 changed files with 10 additions and 1 deletions

View File

@@ -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("⬤"))
}

View File

@@ -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
}