mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Use actual ellipsis character instead of ... to truncate strings
Space is scarce in lazygit's UI, and using ... wastes a lot of it.
This commit is contained in:
@ -161,10 +161,10 @@ func MaxFn[T any](items []T, fn func(T) int) int {
|
||||
|
||||
// TruncateWithEllipsis returns a string, truncated to a certain length, with an ellipsis
|
||||
func TruncateWithEllipsis(str string, limit int) string {
|
||||
if runewidth.StringWidth(str) > limit && limit <= 3 {
|
||||
if runewidth.StringWidth(str) > limit && limit <= 2 {
|
||||
return strings.Repeat(".", limit)
|
||||
}
|
||||
return runewidth.Truncate(str, limit, "...")
|
||||
return runewidth.Truncate(str, limit, "…")
|
||||
}
|
||||
|
||||
func SafeTruncate(str string, limit int) string {
|
||||
|
Reference in New Issue
Block a user