From 50bfc26ca7ab4753049acb36077b9dbb08a091d9 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 12 Feb 2021 13:56:02 -0800 Subject: [PATCH] ;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. --- hledger-lib/Hledger/Data/Posting.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Data/Posting.hs b/hledger-lib/Hledger/Data/Posting.hs index 6833f77d4..7e2679ce8 100644 --- a/hledger-lib/Hledger/Data/Posting.hs +++ b/hledger-lib/Hledger/Data/Posting.hs @@ -377,7 +377,7 @@ commentAddTag c (t,v) -- A space is inserted following the colon, before the value. commentAddTagNextLine :: Text -> Tag -> Text 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