aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorYang Zhang <yang_zhang@iapcm.ac.cn>2018-12-28 22:50:15 +0800
committerYang Zhang <yang_zhang@iapcm.ac.cn>2018-12-30 08:38:31 +0800
commit52419165350a2b36706a6fb67acda862d80d6730 (patch)
tree51b4c111f6501dc875b3ca4c01834cdd8d1334fe /util
parentd823bc572801c8f324584e6fd85c57bc83d551db (diff)
downloadgit-bug-52419165350a2b36706a6fb67acda862d80d6730.tar.gz
Use ASCII ellipsis to workaround inaccurate width of unicode ellipsis
Diffstat (limited to 'util')
-rw-r--r--util/text/left_padded.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/text/left_padded.go b/util/text/left_padded.go
index 3b8e13c6..24bd4d09 100644
--- a/util/text/left_padded.go
+++ b/util/text/left_padded.go
@@ -10,12 +10,12 @@ import (
// LeftPadMaxLine pads a string on the left by a specified amount and pads the
// string on the right to fill the maxLength
func LeftPadMaxLine(text string, length, leftPad int) string {
- rightPart := text
+ var rightPart string = text
scrWidth := runewidth.StringWidth(text)
// truncate and ellipse if needed
if scrWidth+leftPad > length {
- rightPart = runewidth.Truncate(text, length-leftPad, "…")
+ rightPart = runewidth.Truncate(text, length-leftPad, "...")
} else if scrWidth+leftPad < length {
rightPart = runewidth.FillRight(text, length-leftPad)
}