on master help sign in
Graphics.Vty.UnicodeWidthTable.Query: document mkRanges
commit5ed59bb70de4882b4df818848ce34c125246444c authorJonathan Daugherty <cygnus@foobox.com> dateThu 5 Mar 2020, 10:19 (7 years ago) parentd064556
1 file changed+4
src/Graphics/Vty/UnicodeWidthTable/Query.hs+4
src/Graphics/Vty/UnicodeWidthTable/Query.hs+4
@@ -26,6 +26,10 @@ charWidth c = do
2626 Just (_, col) <- getCursorPosition
2727 return col
2828
29+-- | Convert a sequence of character/width pairs into a list of
30+-- run-length encoded ranges. This function assumes the pairs come
31+-- sorted by character ordinal value. It does not require that the
32+-- character range is fully covered by the sequence.
2933mkRanges :: [(Char, Int)] -> [WidthTableRange]
3034mkRanges pairs =
3135 let convertedPairs = convert <$> pairs