summaryrefslogtreecommitdiffhomepage
path: root/Xmobar.hs
diff options
context:
space:
mode:
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