From 4132e9e9ac3695d019f454e80bf6ebc248459752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Rainone?= <476650+arl@users.noreply.github.com> Date: Thu, 20 Feb 2025 01:07:44 +0530 Subject: [PATCH] Cosmetics --- tmux/formater.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tmux/formater.go b/tmux/formater.go index f601ff8..a7a87f3 100644 --- a/tmux/formater.go +++ b/tmux/formater.go @@ -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) }