diff options
-rw-r--r-- | src/report.cc | 7 | ||||
-rw-r--r-- | src/report.h | 6 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/report.cc b/src/report.cc index 1c654e75..d8f1c71f 100644 --- a/src/report.cc +++ b/src/report.cc @@ -1651,6 +1651,13 @@ expr_t::ptr_op_t report_t::lookup(const symbol_t::kind_t kind, case 'b': if (*(p + 1) == '\0' || is_eq(p, "bal") || is_eq(p, "balance")) { + // jww (2023-01-27): This next 'if' statement is a hack for historical + // purposes. Until this date, the balance report always used an amount + // width of 20. If the user has set the amount width, this should be + // used instead; but if they haven't, we need to use the old default + // in order for the tests to pass. + if (! HANDLED(amount_width_)) + HANDLER(amount_width_).value = "20"; return FORMATTED_ACCOUNTS_REPORTER(balance_format_); } else if (is_eq(p, "budget")) { diff --git a/src/report.h b/src/report.h index a711793d..ebaa3812 100644 --- a/src/report.h +++ b/src/report.h @@ -419,8 +419,8 @@ public: CTOR(report_t, balance_format_) { on(none, "%(ansify_if(" - " justify(scrub(display_total), int(amount_width)," - " int(amount_width) + int(prepend_width), true, color)," + " justify(scrub(display_total), max(int(amount_width),20)," + " max(int(amount_width),20) + int(prepend_width), true, color)," " bold if should_bold))" " %(!options.flat ? depth_spacer : \"\")" "%-(ansify_if(" @@ -428,7 +428,7 @@ public: " bold if should_bold))\n%/" "%$1\n%/" "%(prepend_width ? \" \" * int(prepend_width) : \"\")" - "%(\"-\" * int(amount_width))\n"); + "%(\"-\" * max(int(amount_width),20))\n"); }); OPTION(report_t, base); |