File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ type Theme struct {
122122 pm Style
123123 highlight Style
124124 names * Palette
125+ useID bool
125126}
126127
127128func (theme Theme ) ID () string {
@@ -130,11 +131,17 @@ func (theme Theme) ID() string {
130131
131132// Colorize name string given some index
132133func (theme Theme ) ColorName (u * User ) string {
134+ var name string
135+ if theme .useID {
136+ name = u .ID ()
137+ } else {
138+ name = u .Name ()
139+ }
133140 if theme .names == nil {
134- return u . Name ()
141+ return name
135142 }
136143
137- return theme .names .Get (u .colorIdx ).Format (u . Name () )
144+ return theme .names .Get (u .colorIdx ).Format (name )
138145}
139146
140147// Colorize the PM string
@@ -226,7 +233,8 @@ func init() {
226233 highlight : style (Bold + "\033 [48;5;22m\033 [38;5;46m" ), // Green on dark green
227234 },
228235 {
229- id : "mono" ,
236+ id : "mono" ,
237+ useID : true ,
230238 },
231239 }
232240
You can’t perform that action at this time.
0 commit comments