aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2009-11-15 03:34:51 +0100
committerAdam Vogt <vogt.adam@gmail.com>2009-11-15 03:34:51 +0100
commit319c32cbd36e56bd908f521ec158e2a43c06504e (patch)
tree37afda57ed15ea9f5391a3b5fef42c9d5da23991
parentaf442ded0759b24906eac4f71a369207020345d7 (diff)
downloadXMonadContrib-319c32cbd36e56bd908f521ec158e2a43c06504e.tar.gz
XMonadContrib-319c32cbd36e56bd908f521ec158e2a43c06504e.tar.xz
XMonadContrib-319c32cbd36e56bd908f521ec158e2a43c06504e.zip
Use zipWithM_ instead of recursion in Prompt.printComplList
Ignore-this: 2457500ed871ef120653a3d4ada13441 darcs-hash:20091115023451-1499c-c72a17e4146be3caa97728f10dc7e39270a01c39.gz
-rw-r--r--XMonad/Prompt.hs31
1 files changed, 9 insertions, 22 deletions
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