hledger
hledger copied to clipboard
hledger-ui accounts screen fails to colour all of a negative amount's commodity symbol if it contains a comma
From a report by glguy:
2022-01-01
(a) -1 "A, B"
$ hledger-ui # should color all of "A, B" red
Having a little trouble reproducing it with the underlying code, this seems to work as expected:
ghci> putStrLn $ wbUnpack $ showAmountB oneLine{displayColour=True} (num (-1)){acommodity=T.pack "A, B"} -- prints all in red
"A, B"-1
It works fine on the register screen, but not on the accounts screen.
It looks like the problem is here: https://github.com/simonmichael/hledger/blob/e9c19e12ef62d46f57d3cbbd6814dbcf04bbc508/hledger-ui/Hledger/UI/AccountsScreen.hs#L220