@@ -365,6 +365,7 @@ wrapWithOffsetAndAlignment
365 -> [WrappedLine] -- (words on that line, hidden space char, offset from beginning of line)
365 -> [WrappedLine] -- (words on that line, hidden space char, offset from beginning of line)
366wrapWithOffsetAndAlignment _ maxWidth _ _ | maxWidth <= 0 = []
366wrapWithOffsetAndAlignment _ maxWidth _ _ | maxWidth <= 0 = []
367wrapWithOffsetAndAlignment alignment maxWidth n txt = assert (n <= maxWidth) r where
367wrapWithOffsetAndAlignment alignment maxWidth n txt = assert (n <= maxWidth) r where
368+ -- we pad by offset amount with any non-space character which we will remove later so that no changes need to be made to splitWordsAtDisplayWidth
368 r' = splitWordsAtDisplayWidth maxWidth $ wordsWithWhitespace ( T.replicate n "." <> txt)
369 r' = splitWordsAtDisplayWidth maxWidth $ wordsWithWhitespace ( T.replicate n "." <> txt)
369 fmapfn (t,b) = case alignment of
370 fmapfn (t,b) = case alignment of
370 TextAlignment_Left -> WrappedLine t b 0
371 TextAlignment_Left -> WrappedLine t b 0
@@ -378,7 +379,7 @@ wrapWithOffsetAndAlignment alignment maxWidth n txt = assert (n <= maxWidth) r w
379-- converts deleted eol spaces into logical lines
380-- converts deleted eol spaces into logical lines
380eolSpacesToLogicalLines :: [[WrappedLine]] -> [[(Text, Int)]]
381eolSpacesToLogicalLines :: [[WrappedLine]] -> [[(Text, Int)]]
381−eolSpacesToLogicalLines = fmap (fmap (\(WrappedLine a _ c) -> (a,c))) . ((L.groupBy (\(WrappedLine _ b _) _ -> not b)) =<<)
382+eolSpacesToLogicalLines = fmap (fmap (\(WrappedLine a _ c) -> (a,c))) . concatMap (L.groupBy (\(WrappedLine _ b _) _ -> not b))
383offsetMapWithAlignmentInternal :: [[WrappedLine]] -> OffsetMapWithAlignment
384offsetMapWithAlignmentInternal :: [[WrappedLine]] -> OffsetMapWithAlignment
384offsetMapWithAlignmentInternal = offsetMapWithAlignment . eolSpacesToLogicalLines
385offsetMapWithAlignmentInternal = offsetMapWithAlignment . eolSpacesToLogicalLines