From 049ae66af20a15a04dcda5579fd334ae7f1b2c47 Mon Sep 17 00:00:00 2001 From: Theo Brigitte Date: Fri, 29 Aug 2025 10:13:59 +0200 Subject: [PATCH] Fix list display length with pinned version --- cmd/list.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/list.go b/cmd/list.go index 7e18b2c..de30fc1 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -51,8 +51,12 @@ func newListCmd() *listCmd { maxLengths[0] = len(p) } - if len(b.Version) > maxLengths[1] { - maxLengths[1] = len(b.Version) + versionLength := len(b.Version) + if b.Pinned { + versionLength++ // for the '*' char + } + if versionLength > maxLengths[1] { + maxLengths[1] = versionLength } if len(b.URL) > maxLengths[2] { @@ -79,7 +83,7 @@ func newListCmd() *listCmd { } if b.Pinned { - fmt.Printf("\n%s %s %s %s", _rPad(p, pL), "*"+_rPad(b.Version, vL), _rPad(b.URL, uL), status) + fmt.Printf("\n%s %s %s %s", _rPad(p, pL), _rPad("*"+b.Version, vL), _rPad(b.URL, uL), status) continue }