diff --git a/hledger/Hledger/Cli/Commands.hs b/hledger/Hledger/Cli/Commands.hs index c11c2d0bc..3e7710f97 100644 --- a/hledger/Hledger/Cli/Commands.hs +++ b/hledger/Hledger/Cli/Commands.hs @@ -277,7 +277,7 @@ multicol _ [] = [] multicol width strs = let maxwidth = maximum' $ map length strs - numcols = width `div` (maxwidth+2) + numcols = min (length strs) (width `div` (maxwidth+2)) itemspercol = length strs `div` numcols colitems = chunksOf itemspercol strs cols = map unlines colitems