hledger icon indicating copy to clipboard operation
hledger copied to clipboard

hledger-ui accounts screen fails to colour all of a negative amount's commodity symbol if it contains a comma

Open simonmichael opened this issue 4 years ago • 2 comments

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

simonmichael avatar Feb 18 '22 01:02 simonmichael

It works fine on the register screen, but not on the accounts screen.

Xitian9 avatar Feb 18 '22 08:02 Xitian9

It looks like the problem is here: https://github.com/simonmichael/hledger/blob/e9c19e12ef62d46f57d3cbbd6814dbcf04bbc508/hledger-ui/Hledger/UI/AccountsScreen.hs#L220

Xitian9 avatar Feb 18 '22 08:02 Xitian9