From 2bb309b073a960946e86876a9bc1da9a5d96aee9 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Wed, 8 Dec 2021 17:17:57 -1000 Subject: [PATCH] fix: ui: don't show root account, respect not:ACCT (fix #1782) --- hledger-lib/Hledger/Utils.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Utils.hs b/hledger-lib/Hledger/Utils.hs index 23839ce8f..c45ab6972 100644 --- a/hledger-lib/Hledger/Utils.hs +++ b/hledger-lib/Hledger/Utils.hs @@ -120,8 +120,9 @@ splitAtElement x l = -- trees +-- | Get the leaves of this tree as a list. The root node is not counted as a leaf. treeLeaves :: Tree a -> [a] -treeLeaves = foldTree (\a bs -> (if null bs then (a:) else id) $ concat bs) +treeLeaves = drop 1 . foldTree (\a bs -> (if null bs then (a:) else id) $ concat bs) -- text