Skip to content

Commit

Permalink
print fix
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Sep 13, 2024
1 parent 5aa0311 commit 563f491
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ledger/cmd/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func cliTransactions() ([]*ledger.Transaction, error) {
}
}
}
spaceStr = strings.Repeat(" ", columnWidth)

parsedStartDate, tstartErr := date.Parse(startString)
parsedEndDate, tendErr := date.Parse(endString)
Expand Down Expand Up @@ -160,6 +159,10 @@ func PrintBalances(accountList []*ledger.Account, printZeroBalances bool, depth,

// WriteTransaction writes a transaction formatted to fit in specified column width.
func WriteTransaction(w io.StringWriter, trans *ledger.Transaction, columns int) {
if len(spaceStr) < columns {
spaceStr = strings.Repeat(" ", columns)
}

for _, c := range trans.Comments {
w.WriteString(c)
w.WriteString(newLine)
Expand Down

0 comments on commit 563f491

Please sign in to comment.