mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
support user-configurable author colours
This commit is contained in:
@ -11,6 +11,8 @@ import (
|
||||
"github.com/mattn/go-runewidth"
|
||||
)
|
||||
|
||||
// if these being global variables causes trouble we can wrap them in a struct
|
||||
// attached to the gui state.
|
||||
var authorInitialCache = make(map[string]string)
|
||||
var authorNameCache = make(map[string]string)
|
||||
var authorStyleCache = make(map[string]style.TextStyle)
|
||||
@ -101,3 +103,10 @@ func getFirstRune(str string) rune {
|
||||
// should never land here
|
||||
return 0
|
||||
}
|
||||
|
||||
func SetCustomAuthors(customAuthorColors map[string]string) {
|
||||
for authorName, colorSequence := range customAuthorColors {
|
||||
style := style.New().SetFg(style.NewRGBColor(color.HEX(colorSequence, false)))
|
||||
authorStyleCache[authorName] = style
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user