mirror of
https://github.com/arl/gitmux.git
synced 2026-09-10 07:26:18 -04:00
Cosmetics (#122)
Some checks failed
Test, Build and Publish / tests (macos-latest) (push) Has been cancelled
Test, Build and Publish / tests (ubuntu-latest) (push) Has been cancelled
Test, Build and Publish / Build and Publish (push) Has been cancelled
Test, Build and Publish / Check Brew Tap (push) Has been cancelled
Some checks failed
Test, Build and Publish / tests (macos-latest) (push) Has been cancelled
Test, Build and Publish / tests (ubuntu-latest) (push) Has been cancelled
Test, Build and Publish / Build and Publish (push) Has been cancelled
Test, Build and Publish / Check Brew Tap (push) Has been cancelled
This commit is contained in:
parent
88a3d6df03
commit
65d38e0845
|
|
@ -110,9 +110,9 @@ type Formater struct {
|
|||
// If max is zero, negative or greater than the number of runes in s, truncate
|
||||
// just returns s.
|
||||
//
|
||||
// NOTE: If max is lower than len(ellipsis), in other words it we're not even
|
||||
// NOTE: If max is lower than len(ellipsis), in other words if we're not even
|
||||
// allowed to just return the ellipsis string, then we just return the maximum
|
||||
// number of runes we can, without inserting ellpisis.
|
||||
// number of runes we can, without inserting ellipsis.
|
||||
func truncate(s, ellipsis string, max int, dir direction) string {
|
||||
slen := utf8.RuneCountInString(s)
|
||||
if max <= 0 || slen <= max {
|
||||
|
|
@ -144,6 +144,7 @@ func truncate(s, ellipsis string, max int, dir direction) string {
|
|||
runes = append(runes[:llen], ell...)
|
||||
runes = append(runes, right...)
|
||||
}
|
||||
|
||||
return string(runes)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue