diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-28 23:38:37 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2007-10-28 23:38:37 +0100 |
commit | 15d0e2b383376f047ccc563254a285e58e134340 (patch) | |
tree | c8718622ef71f5fcc91b1a6c198e1c749122129b | |
parent | 3f98c86d8430e5d9ce0f316c57a80818912abd93 (diff) | |
download | xmobar-15d0e2b383376f047ccc563254a285e58e134340.tar.gz xmobar-15d0e2b383376f047ccc563254a285e58e134340.tar.bz2 |
Avoid irrefutable pattern in handling text alignment
darcs-hash:20071028223837-d6583-9a70143b0fdd4107959893acab34a481bd7603e4.gz
-rw-r--r-- | Xmobar.hs | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |