on develop help sign in
Wrapping: Don't try to wrap if width is <1
commit03f748031e2e6e13c1013e5b74f70aa2ba4f89a1 authorAli Abrar <aliabrar@gmail.com> dateSat 3 Nov 2018, 15:00 (8 years ago) parentcc3df47
1 file changed+1
src/Reflex/Vty/Widget.hs+1
src/Reflex/Vty/Widget.hs+1
@@ -443,6 +443,7 @@ wrapText maxWidth attrs = V.vertCat
443443 . T.split (=='\n')
444444
445445wrapWithOffset :: Int -> Int -> Text -> [Text]
446+wrapWithOffset maxWidth _ _ | maxWidth <= 0 = []
446447wrapWithOffset maxWidth n xs =
447448 let (firstLine, rest) = T.splitAt (maxWidth - n) xs
448449 in firstLine : (fmap (T.take maxWidth) . takeWhile (not . T.null) . iterate (T.drop maxWidth) $ rest)