diff --git a/hledger-lib/Hledger/Reports/BudgetReport.hs b/hledger-lib/Hledger/Reports/BudgetReport.hs index b123ddeb6..12dd3d09f 100644 --- a/hledger-lib/Hledger/Reports/BudgetReport.hs +++ b/hledger-lib/Hledger/Reports/BudgetReport.hs @@ -341,6 +341,7 @@ budgetReportAsTable )) -- XXX here for now +-- TODO: does not work for flat-by-default reports with --flat not specified explicitly -- | Drop leading components of accounts names as specified by --drop, but only in --flat mode. maybeAccountNameDrop :: ReportOpts -> AccountName -> AccountName maybeAccountNameDrop opts a | flat_ opts = accountNameDrop (drop_ opts) a diff --git a/hledger/Hledger/Cli/Commands/Accounts.hs b/hledger/Hledger/Cli/Commands/Accounts.hs index 49ee47b4e..61087b5a4 100644 --- a/hledger/Hledger/Cli/Commands/Accounts.hs +++ b/hledger/Hledger/Cli/Commands/Accounts.hs @@ -98,5 +98,5 @@ accounts CliOpts{rawopts_=rawopts, reportopts_=ropts} j = do where render a | tree_ ropts = T.replicate (2 * (accountNameLevel a - 1)) " " <> accountLeafName a - | otherwise = maybeAccountNameDrop ropts a + | otherwise = accountNameDrop (drop_ ropts) a