summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation/tags.go
blob: 529e346080f543c2d770ba6553f225b4e1c2c72a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package presentation

import (
	"github.com/jesseduffield/lazygit/pkg/commands/models"
	"github.com/jesseduffield/lazygit/pkg/theme"
)

func GetTagListDisplayStrings(tags []*models.Tag, diffName string) [][]string {
	lines := make([][]string, len(tags))

	for i := range tags {
		diffed := tags[i].Name == diffName
		lines[i] = getTagDisplayStrings(tags[i], diffed)
	}

	return lines
}

// getTagDisplayStrings returns the display string of branch
func getTagDisplayStrings(t *models.Tag, diffed bool) []string {
	attr := theme.DefaultTextColor
	if diffed {
		attr = theme.DiffTerminalColor
	}
	return []string{attr.Sprint(t.Name)}
}