From 319c32cbd36e56bd908f521ec158e2a43c06504e Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Sun, 15 Nov 2009 03:34:51 +0100 Subject: Use zipWithM_ instead of recursion in Prompt.printComplList Ignore-this: 2457500ed871ef120653a3d4ada13441 darcs-hash:20091115023451-1499c-c72a17e4146be3caa97728f10dc7e39270a01c39.gz --- XMonad/Prompt.hs | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'XMonad/Prompt.hs') diff --git a/XMonad/Prompt.hs b/XMonad/Prompt.hs index 94dc133..16e568a 100644 --- a/XMonad/Prompt.hs +++ b/XMonad/Prompt.hs @@ -729,28 +729,15 @@ redrawComplWin compl = do printComplList :: Display -> Drawable -> GC -> String -> String -> [Position] -> [Position] -> [[String]] -> XP () -printComplList _ _ _ _ _ _ _ [] = return () -printComplList _ _ _ _ _ [] _ _ = return () -printComplList d drw gc fc bc (x:xs) y (s:ss) = do - printComplColumn d drw gc fc bc x y s - printComplList d drw gc fc bc xs y ss - -printComplColumn :: Display -> Drawable -> GC -> String -> String - -> Position -> [Position] -> [String] -> XP () -printComplColumn _ _ _ _ _ _ _ [] = return () -printComplColumn _ _ _ _ _ _ [] _ = return () -printComplColumn d drw gc fc bc x (y:yy) (s:ss) = do - printComplString d drw gc fc bc x y s - printComplColumn d drw gc fc bc x yy ss - -printComplString :: Display -> Drawable -> GC -> String -> String - -> Position -> Position -> String -> XP () -printComplString d drw gc fc bc x y s = do - st <- get - if completionToCommand (xptype st) s == commandToComplete (xptype st) (command st) - then printStringXMF d drw (fontS st) gc - (fgHLight $ config st) (bgHLight $ config st) x y s - else printStringXMF d drw (fontS st) gc fc bc x y s +printComplList d drw gc fc bc xs ys sss = + zipWithM_ (\x ss -> + zipWithM_ (\y s -> do + st <- get + let (f,b) = if completionToCommand (xptype st) s == commandToComplete (xptype st) (command st) + then (fgHLight $ config st,bgHLight $ config st) + else (fc,bc) + printStringXMF d drw (fontS st) gc f b x y s) + ys ss) xs sss -- History -- cgit v1.2.3