From cec9e0ccb3afd0d940166f9ee92787b8a357f228 Mon Sep 17 00:00:00 2001 From: mbays Date: Thu, 29 Dec 2022 00:00:00 +0000 Subject: [PATCH] really fix bug in wrapping long words --- TextGemini.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/TextGemini.hs b/TextGemini.hs index f42861b..4d5b413 100644 --- a/TextGemini.hs +++ b/TextGemini.hs @@ -111,13 +111,11 @@ printGemDoc (GemRenderOpts ansi preOpt width linkDescFirst) maxWCWidth = 2 ww = max maxWCWidth wrapWidth wrap' l n ws | n > ww = - chunkVisible l : wrap' "" 0 ws + chunkVisible l : if null ws then [] else wrap' "" 0 ws where chunkVisible s | T.null s = [] chunkVisible s = let (a,b) = splitAtVisible ww s in a : chunkVisible b - wrap' l _ [] - | T.null l = [] - | otherwise = [[l]] + wrap' l _ [] = [[l]] wrap' l n (w:ws) = let l' = if T.null l then w else l <> " " <> w nw = visibleLength w -- 2.11.4.GIT