From dcf48c263980ea24a1587ec0673e73c5918ac97e Mon Sep 17 00:00:00 2001 From: CrystalSplitter Date: Sun, 17 Mar 2024 12:26:24 -0700 Subject: [PATCH] Update minor docs in Events.hs --- lib/ghcitui-brick/Ghcitui/Brick/Events.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ghcitui-brick/Ghcitui/Brick/Events.hs b/lib/ghcitui-brick/Ghcitui/Brick/Events.hs index 0e0e6e7..b425648 100644 --- a/lib/ghcitui-brick/Ghcitui/Brick/Events.hs +++ b/lib/ghcitui-brick/Ghcitui/Brick/Events.hs @@ -245,7 +245,9 @@ appendToLogs logs promptEntry state = state{interpLogs = take interpreterLogLimi -- TODO: Should be configurable? interpreterLogLimit = 1000 --- | Reflow entries of text into columns. +{- | Reflow entries of text into columns. + Mostly useful right now for printing autocomplete suggestions into columns. +-} reflowText :: Int -- ^ Num columns @@ -265,6 +267,7 @@ reflowText numCols colWidth = go maxTextLen = colWidth - 1 makeLine xs = T.concat (T.justifyLeft colWidth ' ' . shortenText maxTextLen <$> xs) +-- | Limit text to a given length, and cut with an elipses. shortenText :: Int -> T.Text -> T.Text shortenText maxLen text | len <= maxLen = text