@@ -438,9 +438,7 @@ afterBreak s = Doc $ singleton (AfterBreak s)
439-- | Returns the width of a 'Doc'.
439-- | Returns the width of a 'Doc'.
440offset :: Doc -> Int
440offset :: Doc -> Int
441−offset d = case map realLength . lines . render Nothing $ d of
441+offset d = maximum (0: map realLength (lines $ render Nothing d))
445-- | Returns the minimal width of a 'Doc' when reflowed at breakable spaces.
443-- | Returns the minimal width of a 'Doc' when reflowed at breakable spaces.
446minOffset :: Doc -> Int
444minOffset :: Doc -> Int