1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

feat(gui): show remote icons

This commit is contained in:
Ryooooooga
2022-04-23 11:42:24 +09:00
parent 11d0e7e17d
commit f972d6ae68
2 changed files with 40 additions and 6 deletions

View File

@ -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/gui/style"
"github.com/jesseduffield/lazygit/pkg/theme"
)
@ -23,5 +24,10 @@ func getRemoteDisplayStrings(r *models.Remote, diffed bool) []string {
textStyle = theme.DiffTerminalColor
}
return []string{textStyle.Sprint(r.Name), style.FgBlue.Sprintf("%d branches", branchCount)}
res := make([]string, 0, 3)
if icons.IsIconEnabled() {
res = append(res, textStyle.Sprint(icons.IconForRemote(r)))
}
res = append(res, textStyle.Sprint(r.Name), style.FgBlue.Sprintf("%d branches", branchCount))
return res
}