diff options
author | tv <tv@krebsco.de> | 2021-02-23 20:45:49 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2021-02-23 20:45:49 +0100 |
commit | 9d529a570e84540fafde36d0e0adba87a610c126 (patch) | |
tree | 977b3f7a029a655f4bf25328804c1bf0e3364015 /src | |
parent | 03fcdacc80c7044047b544aa69ae9ecc6f7902b4 (diff) |
modernize calls to blessings
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.hs | 8 | ||||
-rw-r--r-- | src/Process.hs | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs index c07053f..9725d7a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -29,6 +29,8 @@ import Buffer import Process import Scanner import Blessings +import qualified Blessings.Internal as Blessings +import Blessings.String () data Mode @@ -393,7 +395,7 @@ renderRight :: Blessings String -> IO () renderRight a = do saveCursor moveCursorRight 1024 -- XXX obviously, this is a hack..^_^ - moveCursorLeft $ len a - 1 + moveCursorLeft $ Blessings.length a - 1 renderLeft a unsaveCursor @@ -417,12 +419,12 @@ spans p xs = f_r (span p_r xs) f_l (as, bs) = Left as : if null bs then [] else f_r (span p_r bs) -gaudySpans :: [Int] -> (Char -> Bool) -> String -> Blessings String +gaudySpans :: Pm -> (Char -> Bool) -> String -> Blessings String gaudySpans c p = mconcat . map (either (SGR c . Plain . lit) Plain) . spans p -gaudySpecial :: [Int] -> String -> Blessings String +gaudySpecial :: Pm -> String -> Blessings String gaudySpecial c = gaudySpans c (not . isPrint) diff --git a/src/Process.hs b/src/Process.hs index df05155..41ea113 100644 --- a/src/Process.hs +++ b/src/Process.hs @@ -13,6 +13,7 @@ import System.IO import System.Process import Blessings +import Blessings.String () type OutputWrapper = IO () -> IO () |