summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2021-09-06 20:26:40 +0200
committerChristian Muehlhaeuser <muesli@gmail.com>2021-09-06 20:36:11 +0200
commitb941c9353358c45846a86c1462a620be83060ef8 (patch)
tree5e1b1aa854b92bec26d5d0621f56a3de52cb5139
parent416cffb79748c40e0f1e5d501cba75beb65bee0e (diff)
Truncate strings with an ellipsis
-rw-r--r--branch.go2
-rw-r--r--commit.go2
-rw-r--r--issue.go2
-rw-r--r--pr.go2
4 files changed, 4 insertions, 4 deletions
diff --git a/branch.go b/branch.go
index 0121eaf..0a6165b 100644
--- a/branch.go
+++ b/branch.go
@@ -66,7 +66,7 @@ func printBranch(branch Branch, maxWidth int) {
var s string
s += numberStyle.Render(branch.Name)
s += genericStyle.Render(" ")
- s += titleStyle.Render(truncate.String(branch.LastCommit.MessageHeadline, uint(80-maxWidth)))
+ s += titleStyle.Render(truncate.StringWithTail(branch.LastCommit.MessageHeadline, uint(80-maxWidth), "…"))
s += genericStyle.Render(" ")
s += timeStyle.Render(ago(branch.LastCommit.CommittedAt))
s += genericStyle.Render(" ")
diff --git a/commit.go b/commit.go
index 8216219..f5ea744 100644
--- a/commit.go
+++ b/commit.go
@@ -94,7 +94,7 @@ func printCommit(commit Commit) {
var s string
s += numberStyle.Render(commit.ID[:7])
s += genericStyle.Render(" ")
- s += titleStyle.Render(truncate.String(commit.MessageHeadline, 80-7))
+ s += titleStyle.Render(truncate.StringWithTail(commit.MessageHeadline, 80-7, "…"))
s += genericStyle.Render(" ")
s += timeStyle.Render(ago(commit.CommittedAt))
s += genericStyle.Render(" ")
diff --git a/issue.go b/issue.go
index 7db4d5a..124bb61 100644
--- a/issue.go
+++ b/issue.go
@@ -105,7 +105,7 @@ func printIssue(issue Issue, maxWidth int) {
var s string
s += numberStyle.Render(strconv.Itoa(issue.ID))
s += genericStyle.Render(" ")
- s += titleStyle.Render(truncate.String(issue.Title, uint(80-maxWidth)))
+ s += titleStyle.Render(truncate.StringWithTail(issue.Title, uint(80-maxWidth), "…"))
s += genericStyle.Render(" ")
s += timeStyle.Render(ago(issue.CreatedAt))
s += genericStyle.Render(" ")
diff --git a/pr.go b/pr.go
index fa35b16..e4db61d 100644
--- a/pr.go
+++ b/pr.go
@@ -106,7 +106,7 @@ func printPullRequest(pr PullRequest, maxWidth int) {
var s string
s += numberStyle.Render(strconv.Itoa(pr.ID))
s += genericStyle.Render(" ")
- s += titleStyle.Render(truncate.String(pr.Title, uint(80-maxWidth)))
+ s += titleStyle.Render(truncate.StringWithTail(pr.Title, uint(80-maxWidth), "…"))
s += genericStyle.Render(" ")
s += timeStyle.Render(ago(pr.CreatedAt))
s += genericStyle.Render(" ")