diff options
author | Michael Muré <batolettre@gmail.com> | 2020-09-27 21:30:13 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-09-27 21:30:13 +0200 |
commit | 148b335dd345347af24487d6130bc713a6387bdc (patch) | |
tree | 14802fd242fc19fa53e86dd2396bb37c8a4e5b79 | |
parent | ae0529e3f54eb7bd3b464e2717c82db975fb88c9 (diff) | |
download | git-bug-148b335dd345347af24487d6130bc713a6387bdc.tar.gz |
command: match the output in ls and in the termui
-rw-r--r-- | commands/ls.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/commands/ls.go b/commands/ls.go index 9a863638..9eaabb12 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -212,9 +212,12 @@ func lsDefaultFormatter(env *Env, bugExcerpts []*cache.BugExcerpt) error { titleFmt := text.LeftPadMaxLine(strings.TrimSpace(b.Title), 50-text.Len(labelsFmt), 0) authorFmt := text.LeftPadMaxLine(name, 15, 0) - comments := fmt.Sprintf("%4d 💬", b.LenComments) - if b.LenComments > 9999 { - comments = " ∞ 💬" + comments := fmt.Sprintf("%3d 💬", b.LenComments-1) + if b.LenComments-1 <= 0 { + comments = "" + } + if b.LenComments-1 > 999 { + comments = " ∞ 💬" } env.out.Printf("%s %s\t%s\t%s\t%s\n", |