From 51e3df5fd288c72ab427dda980d6a9f2d6f8adf9 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 28 Dec 2014 04:41:52 +0100 Subject: replace tabs by spaces in Trammel String --- test4.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test4.hs') diff --git a/test4.hs b/test4.hs index b9990a0..d9a2e74 100644 --- a/test4.hs +++ b/test4.hs @@ -124,6 +124,7 @@ redraw :: State -> IO () redraw _q@State{..} = do let image = + map (fmap $ fmap $ sub '\t' ' ') $ map (trammelTake screenWidth . trammelDrop xoffset) $ take screenHeight $ headBuffer ++ drop yoffset treeBuffer @@ -135,6 +136,8 @@ redraw _q@State{..} = do putStr $ pp $ "\ESC[H" <> first <> mconcat (map ("\n"<>) rest) _ -> return () + where + sub x x' c = if c == x then x' else c -- cgit v1.2.3