summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2021-10-23 20:46:37 +0900
committerJesse Duffield <jessedduffield@gmail.com>2021-10-30 18:26:06 +1100
commit6171690b000af4fb495fc9d2930dfa988800ee3f (patch)
tree339b405dbd874ba4412f2c2015137a05b08b91f4 /pkg/gui/presentation
parent253504a0947e0eb734e47d1b869e1a674d21655b (diff)
Fix multibyte initial characters
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/commits.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/gui/presentation/commits.go b/pkg/gui/presentation/commits.go
index 1524734f2..2531f7b81 100644
--- a/pkg/gui/presentation/commits.go
+++ b/pkg/gui/presentation/commits.go
@@ -124,8 +124,8 @@ var authorInitialCache = make(map[string]string)
var authorNameCache = make(map[string]string)
func shortAuthor(authorName string) string {
- if _, ok := authorInitialCache[authorName]; ok {
- return authorInitialCache[authorName]
+ if value, ok := authorInitialCache[authorName]; ok {
+ return value
}
initials := getInitials(authorName)
@@ -140,8 +140,8 @@ func shortAuthor(authorName string) string {
}
func longAuthor(authorName string) string {
- if _, ok := authorNameCache[authorName]; ok {
- return authorNameCache[authorName]
+ if value, ok := authorNameCache[authorName]; ok {
+ return value
}
truncatedName := utils.TruncateWithEllipsis(authorName, 17)
@@ -184,7 +184,7 @@ func getInitials(authorName string) string {
return utils.LimitStr(authorName, 2)
}
- return split[0][0:1] + split[1][0:1]
+ return utils.LimitStr(split[0], 1) + utils.LimitStr(split[1], 1)
}
func actionColorMap(str string) style.TextStyle {