;lib: commentAddTagNextLine was broken

It would not add the tag when a comment already existed.
This affected hledger-print-location.hs and probably
the generated-transaction: tag in periodic transactions.
This commit is contained in:
Simon Michael 2021-02-12 13:56:02 -08:00
parent c8bc9c7088
commit 50bfc26ca7

View File

@ -377,7 +377,7 @@ commentAddTag c (t,v)
-- A space is inserted following the colon, before the value. -- A space is inserted following the colon, before the value.
commentAddTagNextLine :: Text -> Tag -> Text commentAddTagNextLine :: Text -> Tag -> Text
commentAddTagNextLine cmt (t,v) = commentAddTagNextLine cmt (t,v) =
cmt <> if "\n" `T.isSuffixOf` cmt then "" else "\n" <> t <> ": " <> v cmt <> (if "\n" `T.isSuffixOf` cmt then "" else "\n") <> t <> ": " <> v
-- tests -- tests