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

feat(gui): show branch icons

This commit is contained in:
Ryooooooga
2022-04-23 10:57:51 +09:00
parent cb13fe7f46
commit 11d0e7e17d
4 changed files with 45 additions and 8 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/theme"
)
@ -20,5 +21,10 @@ func getRemoteBranchDisplayStrings(b *models.RemoteBranch, diffed bool) []string
textStyle = theme.DiffTerminalColor
}
return []string{textStyle.Sprint(b.Name)}
res := make([]string, 0, 2)
if icons.IsIconEnabled() {
res = append(res, textStyle.Sprint(icons.IconForRemoteBranch(b)))
}
res = append(res, textStyle.Sprint(b.Name))
return res
}