Skip to content

Commit 20eeeee

Browse files
committed
improve output, so that the table doesn't overflow
1 parent 89a19dc commit 20eeeee

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cmd/diff.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type tableRow struct {
4444
Warnings string
4545
}
4646

47-
var widthOfFixedColumns = 45 // rough size of all columns that have a fixed width
47+
var widthOfFixedColumns = 61 // rough combined size of all columns that have a fixed width
4848
var userNameFromCmd string
4949

5050
// tries to find out the width of the terminal and returns 80 if it fails
@@ -183,17 +183,18 @@ var diffCmd = &cobra.Command{
183183
)
184184
countWarnings := 0
185185
if !workPackage.Embedded.Project.Active {
186-
row.Warnings += text.Snip("- inactive project\n", widthContentColumns, "~")
187-
countWarnings++
186+
row.Warnings += "- inactive\n project\n"
187+
countWarnings = countWarnings + 2
188188
}
189189
if !workPackage.Embedded.Project.Favorited {
190-
row.Warnings += text.Snip("- not favorite project\n", widthContentColumns, "~")
191-
countWarnings++
190+
row.Warnings += "- not favorite\n project\n"
191+
countWarnings = countWarnings + 2
192192
}
193193
if workPackage.Embedded.Assignee.Name != tmetricUser.Name && workPackage.Embedded.Assignee.Name != config.OpenProjectTeam {
194-
row.Warnings += text.Snip("- not my assignment\n", widthContentColumns, "~")
195-
countWarnings++
194+
row.Warnings += "- not my\n assignment\n"
195+
countWarnings = countWarnings + 2
196196
}
197+
197198
// Add the remaining newlines to make it 6 rows total
198199
for i := countWarnings; i < 6; i++ {
199200
row.Warnings += "\n"

0 commit comments

Comments
 (0)