aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-18 18:37:47 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-19 20:37:37 +0100
commitcae12591142b38b708bb75e1c879dd9689bf6c12 (patch)
treeea7a231fabd6c521e2f92e5eb33598879037e2f6
parent906f925febc82e90c3398373e56db07fe513efe0 (diff)
downloadaerc-cae12591142b38b708bb75e1c879dd9689bf6c12.tar.gz
format: remove unused code
Remove unused TruncateHead function. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--lib/format/format.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/format/format.go b/lib/format/format.go
index 7c2d5f64..a8600009 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -8,8 +8,6 @@ import (
"unicode"
"github.com/emersion/go-message/mail"
- "github.com/mattn/go-runewidth"
- "github.com/rivo/uniseg"
)
// AddressForHumans formats the address. If the address's name
@@ -66,31 +64,6 @@ func CompactPath(name string, sep rune) (compact string) {
return
}
-func TruncateHead(s string, w int, head string) string {
- width := runewidth.StringWidth(s)
- if width <= w {
- return s
- }
- w -= runewidth.StringWidth(head)
- pos := 0
- g := uniseg.NewGraphemes(s)
- for g.Next() {
- var chWidth int
- for _, r := range g.Runes() {
- chWidth = runewidth.RuneWidth(r)
- if chWidth > 0 {
- break
- }
- }
- if width-chWidth <= w {
- pos, _ = g.Positions()
- break
- }
- width -= chWidth
- }
- return head + s[pos:]
-}
-
func DummyIfZeroDate(date time.Time, format string, todayFormat string,
thisWeekFormat string, thisYearFormat string,
) string {