mirror of
https://github.com/ilyakooo0/reflex-vty.git
synced 2024-11-26 23:36:31 +03:00
Wrapping: Don't try to wrap if width is <1
This commit is contained in:
parent
cc3df47591
commit
03f748031e
@ -443,6 +443,7 @@ wrapText maxWidth attrs = V.vertCat
|
||||
. T.split (=='\n')
|
||||
|
||||
wrapWithOffset :: Int -> Int -> Text -> [Text]
|
||||
wrapWithOffset maxWidth _ _ | maxWidth <= 0 = []
|
||||
wrapWithOffset maxWidth n xs =
|
||||
let (firstLine, rest) = T.splitAt (maxWidth - n) xs
|
||||
in firstLine : (fmap (T.take maxWidth) . takeWhile (not . T.null) . iterate (T.drop maxWidth) $ rest)
|
||||
|
Loading…
Reference in New Issue
Block a user