summaryrefslogtreecommitdiffhomepage
path: root/Xmobar.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-10-28 23:38:37 +0100
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-10-28 23:38:37 +0100
commit15d0e2b383376f047ccc563254a285e58e134340 (patch)
treec8718622ef71f5fcc91b1a6c198e1c749122129b /Xmobar.hs
parent3f98c86d8430e5d9ce0f316c57a80818912abd93 (diff)
downloadxmobar-15d0e2b383376f047ccc563254a285e58e134340.tar.gz
xmobar-15d0e2b383376f047ccc563254a285e58e134340.tar.bz2
Avoid irrefutable pattern in handling text alignment
darcs-hash:20071028223837-d6583-9a70143b0fdd4107959893acab34a481bd7603e4.gz
Diffstat (limited to 'Xmobar.hs')
-rw-r--r--Xmobar.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Xmobar.hs b/Xmobar.hs
index 2c50db6..f1e084e 100644
--- a/Xmobar.hs
+++ b/Xmobar.hs
@@ -168,11 +168,12 @@ updateWin v = do
then alignSep conf
else alignSep defaultConfig
i <- io $ atomically $ readTVar v
- let [l,c,r] = if (lc `elem` i && rc `elem` i)
- then let (le,_:re) = break (==lc) i
- (ce,_:ri) = break (==rc) re
- in [le,ce,ri]
- else [i,[],[]]
+ let def = [i,[],[]]
+ [l,c,r] = case break (==lc) i of
+ (le,_:re) -> case break (==rc) re of
+ (ce,_:ri) -> [le,ce,ri]
+ _ -> def
+ _ -> def
ps <- io $ mapM (parseString conf) [l,c,r]
drawInWin rec ps